Example #1
0
            [TestMethod]                                                // test stubs
            public void Delete_WithNonExistingId_ShouldReturnNotFound() // ServiceMethodToBeTest_ExpectedInput_ExpectedBehavior()
            {
                // arrange

                // act
                var result = sut.DeleteSample(nonExistingId);

                // assert
                mockRepo
                .Verify(
                    r => r.Retrieve(nonExistingId), Times.Once
                    );

                mockRepo
                .Verify(
                    r => r.Delete(nonExistingId), Times.Never
                    );

                Assert.IsInstanceOfType(result, typeof(NotFoundResult));
            }