refactor: move language examples to fixture files

This commit is contained in:
Paul Gauthier (aider) 2024-11-27 07:03:20 -08:00
parent 565f08a8e9
commit 4de8c25a3f
5 changed files with 148 additions and 144 deletions

39
tests/fixtures/languages/csharp/test.cs vendored Normal file
View 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));
}
}
}