Example #1
0
        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());
        }
Example #2
0
        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 }));
        }