public void ShouldAddExecutionToRepository() { // Arrange testCase.Name = "TestCaseName"; // Act testCase.AddExecution("TestDefinition", testCaseRepository, testStepFactory); // Assert Mock.Get(testCaseRepository) .Verify(r => r.AddExecution( It.Is <string>(tc => tc == "TestCaseName"), It.IsAny <TestCaseExecution>()), Times.Once()); }
public ActionResult UpdateDefinition(string testCase, string definition) { var tc = new TestCase(); tc.Name = testCase; tc.AddDefinition(definition, this.repository); tc.AddExecution(definition, this.repository); return(RedirectToAction(nameof(Index), new { testCase = testCase })); }