public Competitions(string competitionName, string levelName, LogicPartHelper logicPartHelper, Func <IKeyboard> keyboardFactory, Func <GameSettings, List <IEngine> > enginesFactory) { CompetitionsName = competitionName; LevelName = levelName; Logic = logicPartHelper.Create(); EnginesFactory = enginesFactory; KeyboardFactory = keyboardFactory; }
public static void Main() { var helpers = new LogicPartHelper[] { new DemoLogicPartHelper(), new DWMLogicPartHelper() }; var builder = new StringBuilder(); foreach (var helper in helpers) { var logicPart = helper.Create(); foreach (var e in logicPart.Tests) { var name = e.Key; var nameParts = name.Split('_'); string beginning = ""; string ending = ""; foreach (var className in nameParts.Take(nameParts.Length - 2)) { beginning += "namespace " + className + " { \n"; ending += "}"; } beginning += "[TestFixture] public partial class " + nameParts[nameParts.Length - 2] + " {\n"; ending += "}"; var methodName = nameParts[nameParts.Length - 1]; var entry = ""; string helperType = helper.GetType().Name.Replace("LogicPartHelper", ""); entry = "[Test] public void " + methodName + "() { TestRunner.Run"+ helperType + "(\"" + name + "\"); }"; builder.Append(beginning + entry + ending + "\n"); } } builder.Insert(0, "using NUnit.Framework;\n"); File.WriteAllText("..\\..\\..\\Demo.Tests\\Tests.cs", builder.ToString()); }
public Competitions(LogicPartHelper logicPartHelper, EnginePart engine, ManagerPart manager) { Logic = logicPartHelper.Create(); Engine = engine; Manager = manager; }