public async Task AddTestCase_Success_CreatedResponse() { //Arrange _testCaseServiceMock.Setup(service => service.AddTestCase(It.IsAny <TestCaseDto>())) .ReturnsAsync(true); // ACT var response = (IActionResult)await _controller.AddTestCase(new TestCaseDto() { TestCaseId = 12, Name = "TestCase12", StepCount = 12, FolderId = 1 }); var result = (StatusCodeResult)response; //Assert Assert.IsNotNull(result); _testCaseServiceMock.Verify(t => t.AddTestCase(It.IsAny <TestCaseDto>()), Times.Once); Assert.IsTrue(result.StatusCode == (int)HttpStatusCode.Created); }