mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 16:25:00 +00:00
refactor: move language examples to fixture files
This commit is contained in:
parent
565f08a8e9
commit
4de8c25a3f
5 changed files with 148 additions and 144 deletions
39
tests/fixtures/languages/csharp/test.cs
vendored
Normal file
39
tests/fixtures/languages/csharp/test.cs
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Greetings {
|
||||
public interface IGreeter {
|
||||
string Greet(string name);
|
||||
}
|
||||
|
||||
public class Person {
|
||||
public string Name { get; set; }
|
||||
public int Age { get; set; }
|
||||
|
||||
public Person(string name, int age) {
|
||||
Name = name;
|
||||
Age = age;
|
||||
}
|
||||
}
|
||||
|
||||
public class FormalGreeter : IGreeter {
|
||||
private const string PREFIX = "Good day";
|
||||
private static readonly int MAX_AGE = 150;
|
||||
|
||||
public string Greet(string name) {
|
||||
return $"{PREFIX}, {name}!";
|
||||
}
|
||||
|
||||
public string GreetPerson(Person person) {
|
||||
return $"{PREFIX}, {person.Name} ({person.Age})!";
|
||||
}
|
||||
}
|
||||
|
||||
public class Program {
|
||||
static void Main() {
|
||||
var greeter = new FormalGreeter();
|
||||
var person = new Person("World", 42);
|
||||
Console.WriteLine(greeter.GreetPerson(person));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue