Exemplo n.º 1
0
        public void Test_For_End_Project_Valid(int projectIdToEnd, bool expectedResult)
        {
            // Arrange
            var expectedTestResult = new OkObjectResult(expectedResult);

            mockProjectsLogic.Setup(api => api.EndProject(projectIdToEnd)).Returns(expectedResult);

            // Act
            var actualResult   = mockController.EndProject(projectIdToEnd);
            var actualProjData = ((OkObjectResult)actualResult).Value;

            // Assert
            Assert.IsType <OkObjectResult>(actualResult);
            Assert.Equal(expectedResult, (bool)actualProjData);
        }