public void Init() { CurrentDirectory = Path.Combine(Directory.GetCurrentDirectory(), "TracerTestTemp"); Directory.CreateDirectory(CurrentDirectory); Factory = new EngineFactory(CurrentDirectory); Tracer = new Tracer(Factory); }
public ManagerWrapper(TerminalWrapper terminal, IEngineFactory engineFactory) { EngineFactory = engineFactory; add(ManagerType.npm, new NpmManager(terminal)); add(ManagerType.pip, new PipManager(terminal)); add(ManagerType.system, new SystemManager(terminal)); }
public PlayerCreator(IPlayerFactory playerFactory, IEngineFactory engineFactory, IArmourFactory armourFactory, IWeaponFactory weaponFactory, ISpaceshipFactory spaceshipFactory, IBulletFactory bulletFactory) { this.playerFactory = playerFactory; this.engineFactory = engineFactory; this.armourFactory = armourFactory; this.weaponFactory = weaponFactory; this.spaceshipFactory = spaceshipFactory; this.bulletFactory = bulletFactory; }
public DefinitionExecutor( ITemplateLoaderFactory templateLoaderFactory, IEngineFactory engineFactory, IResultProcessorFactory resultProcessorFactory ) { _templateLoaderFactory = templateLoaderFactory; _engineFactory = engineFactory; _resultProcessorFactory = resultProcessorFactory; }
public MatchController( DatabaseContext context, ILogger <MatchController> logger, IMapper mapper, IDateTimeProvider dateTimeProvider, IEngineFactory engineFactory) : base(context, logger, mapper) { this.dateTimeProvider = dateTimeProvider; this.engineFactory = engineFactory; }
public TempGameEngineService(ILogger logger, IEngineFactory engineFactory, IInputService inputService) { _logger = logger; _engineFactory = engineFactory; _inputService = inputService; _inputService.MouseDown += OnMouseDown; _logger.Info("Creating a game engine"); Engine = engineFactory.Create(TestData, TestTemplates); }
public EngineService( IEngineFactory engineFactory, IFieldService fieldService, IShapeService shapeService, IInputService inputService ) { this.engineFactory = engineFactory; this.fieldService = fieldService; this.shapeService = shapeService; this.inputService = inputService; }
public CoverageStats(IEngineFactory factory) { _factory = factory; }
public CarFactory(IEngineFactory engineFactory) { _engineFactory = engineFactory; }
public CarFactory(IWheelFactory wheelFactory, IEngineFactory engineFactory, ILanternFactory lanternFactory) { this.WheelFactory = wheelFactory; this.EngineFactory = engineFactory; this.LanternFactory = lanternFactory; }
public TestCaseAnalysis(IEngineFactory engineFactory) { EngineFactory = engineFactory; }
public static Job With(this Job job, IEngineFactory engineFactory) => job.With(job.Infrastructure.EngineFactory.Mutate(engineFactory));
public Tracer(IEngineFactory factory) { Factory = factory; }
public CSharpEngine(IEngineFactory factory) { Factory = factory; }
public BoatSimulatorController() : this(new BoatSimulatorDatabase(), null) { this.engineFactory = new EngineFactory(); }
public BoatSimulatorController(IBoatSimulatorDatabase database, IRace currentRace) { this.Database = database; this.CurrentRace = currentRace; this.engineFactory = new EngineFactory(); }
public static Job With(this Job job, IEngineFactory engineFactory) => job.WithEngineFactory(engineFactory);
public LearningPreprocessor(IEngineFactory factory) { Factory = factory; }
public TemplateExecutor(IEngineFactory engineFactory) { _engineFactory = engineFactory; }
public EngineTestsBase() { Kernel.Bind<ILogger>().ToMock(); Factory = Kernel.Get<IEngineFactory>(); }
public EngineTestsBase() { Kernel.Bind <ILogger>().ToMock(); Factory = Kernel.Get <IEngineFactory>(); }
public static Job With(this Job job, IEngineFactory engineFactory) => job.WithCore(j => j.Infrastructure.EngineFactory = engineFactory);
public PythonEngine(IEngineFactory factory) { Factory = factory; }
public void FullEngineLearningModeShouldPassWithOneTest() { // Arrange FeedbackDto actual = new FeedbackDto(); Factory = new MockEngineFactory(CurrentDirectory, new MockFeedback(f => actual = f)); Engine = new Engine.PythonEngine(Factory); var submission = new SubmissionDto() { ApplicationMode = "Learning Mode", SubmitterId = "Random", SubmissionId = 1, TestCaseSolution = ConvertToZipByteArray( "import sys\r\n" + "sys.path.append('../Solution/')\r\n" + "from solution import func\r\n" + "def test():\r\n" + " assert func() == 3", "test_student.py"), ReferenceSolution = ConvertToZipByteArray( "def func():\r\n" + " return 3", "solution.py"), SolutionFolderName = "Solution", ReferenceTestSolution = ConvertToZipByteArray( "import sys\r\n" + "sys.path.append('../Solution/')\r\n" + "from solution import func\r\n" + "def test_teacher(record_property):\r\n" + " record_property(\"EquivalanceClass\", \"FUNCTION CALL\")\r\n" + " record_property(\"Concepts\", \"func,equals\")\r\n" + " assert func() == 3\r\n" , "test_teacher.py"), }; // Act var feedbackDto = Engine.Run(submission); // Assert var expected = new FeedbackDto() { InstructorTests = new List <InstructorTestDto>() { new InstructorTestDto() { Name = "test_teacher.py::test_teacher", Concepts = new string[] { "func", "equals" }, EquivalenceClass = "FUNCTION CALL", TestStatus = TestStatusEnum.Covered, StudentTests = new List <StudentTestDto>() { new StudentTestDto() { Name = "test_student.py::test", Passed = true, TestStatus = TestStatusEnum.Covered } } } }, CoveragePercentage = 1, NumberOfStatements = 2, NumberOfMissingStatements = 0, NumberOfBranchesHit = 0, SubmissionId = 1, StudentId = "Random" }; Assert.IsTrue(CompareFeedback(expected, actual)); }
public BattleRound(IEngineFactory black, IEngineFactory white) { Black = black; White = white; }
public void Init() { Factory = new EngineFactory(CurrentDirectory); }
public DevelopingPreprocessor(IEngineFactory factory) { Factory = factory; }
public MatchProcessor(IEngineFactory engineFactory) { this.engineFactory = engineFactory; }
public void FullEngineDevelopingModeShouldPassWithMultipleTest() { // Arrange FeedbackDto actual = new FeedbackDto(); Factory = new MockEngineFactory(CurrentDirectory, new MockFeedback(f => actual = f)); Engine = new Engine.PythonEngine(Factory); var submission = new SubmissionDto() { ApplicationMode = "Development Mode", SubmissionId = 1, AssignmentSolution = ConvertToZipByteArray( "class Calc():\r\n" + " def add(self,x,y):\r\n" + " return x + y\r\n" + " def subt(self,x,y):\r\n" + " return x + y\r\n" + " def mult(self,x,y):\r\n" + " return x * y\r\n" + " def div(self,x,y):\r\n" + " return x / y", "solution.py"), TestCaseSolution = ConvertToZipByteArray( "import sys\r\n" + "sys.path.append('../Solution/')\r\n" + "from solution import Calc\r\n" + "def test_add():\r\n" + " assert Calc().add(5,5) == 10\r\n" + "def test_mult():\r\n" + " assert Calc().mult(1,2) == 2\r\n" + "def test_two():\r\n" + " assert Calc().add(4,3) == 7\r\n" + "\r\n" + "def test_div():\r\n" + " assert Calc().div(8,4) == 2\r\n", "test_student.py"), ReferenceSolution = ConvertToZipByteArray( "class Calc():\r\n" + " def add(self,x,y):\r\n" + " return x + y\r\n" + " def subt(self,x,y):\r\n" + " return x - y\r\n" + " def mult(self,x,y):\r\n" + " return x * y", "solution.py"), SolutionFolderName = "Solution", ReferenceTestSolution = ConvertToZipByteArray( "import sys\r\n" + "sys.path.append('../Solution/')\r\n" + "from solution import Calc\r\n" + "class Test():\r\n" + " calculator = Calc()\r\n" + " def test_one(self,record_property):\r\n" + " record_property(\"EquivalanceClass\", \"ADDITION\")\r\n" + " record_property(\"Concepts\", \"add,pos\")\r\n" + " assert self.calculator.add(1,2) == 3\r\n" + " def test_two(self,record_property):\r\n" + " record_property(\"EquivalanceClass\", \"SUBTRACTION\")\r\n" + " record_property(\"Concepts\", \"subt,pos\")\r\n" + " assert self.calculator.subt(4,3) == 1\r\n" + " def test_three(self, record_property):\r\n" + " record_property(\"EquivalanceClass\", \"MULTIPLICATION\")\r\n" + " record_property(\"Concepts\", \"mul,pos\")\r\n" + " assert self.calculator.mult(3,3) == 9\r\n", "test_teacher.py"), }; // Act var feedbackDto = Engine.Run(submission); // Assert var expected = new FeedbackDto() { InstructorTests = new List <InstructorTestDto>() { new InstructorTestDto() { Name = "test_teacher.py::Test::test_one", Concepts = new [] { "add", "pos" }, EquivalenceClass = "ADDITION", StudentTests = new List <StudentTestDto>() { new StudentTestDto() { Name = "test_student.py::test_add", Passed = true, TestStatus = TestStatusEnum.Covered }, new StudentTestDto() { Name = "test_student.py::test_two", Passed = true, TestStatus = TestStatusEnum.Redundant } } }, new InstructorTestDto() { Name = "test_teacher.py::Test::test_two", Concepts = new [] { "subt", "pos" }, EquivalenceClass = "SUBTRACTION", TestStatus = TestStatusEnum.Failed, StudentTests = new List <StudentTestDto>() }, new InstructorTestDto() { Name = "test_teacher.py::Test::test_three", Concepts = new [] { "mul", "pos" }, EquivalenceClass = "MULTIPLICATION", TestStatus = TestStatusEnum.Covered, StudentTests = new List <StudentTestDto>() { new StudentTestDto() { Name = "test_student.py::test_mult", Passed = true, TestStatus = TestStatusEnum.Covered } } } }, SubmissionId = 1, CoveragePercentage = .89, NumberOfStatements = 9, NumberOfMissingStatements = 1, NumberOfBranchesHit = 0 }; Assert.IsTrue(CompareFeedback(expected, actual)); }