mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
test: enhance C# test case with more language features and symbols
This commit is contained in:
parent
8d50bc0ef1
commit
631cdc37c4
1 changed files with 40 additions and 5 deletions
|
@ -598,11 +598,46 @@ export { UserGreeting, useCounter, DEFAULT_NAME, MAX_AGE };
|
||||||
),
|
),
|
||||||
"csharp": (
|
"csharp": (
|
||||||
"test.cs",
|
"test.cs",
|
||||||
(
|
"""using System;
|
||||||
"using System;\n\nclass Program {\n static void Main() {\n "
|
using System.Collections.Generic;
|
||||||
' Console.WriteLine("Hello, World!");\n }\n}\n'
|
|
||||||
),
|
namespace Greetings {
|
||||||
"Program", # Key symbol to check
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}""",
|
||||||
|
"IGreeter", # Key symbol to check
|
||||||
),
|
),
|
||||||
#####################
|
#####################
|
||||||
"dart": (
|
"dart": (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue