public void CreateComment_CallRepository_Success() { // Arrange var repository = new TestSetup().SetupRepository(); var service = new TestSetup().SetupService(mockRepository: repository); // Act service.CreateComment(new Comment()).Wait(); // Assert repository.Verify(i => i.CreateComment(It.IsNotNull <Comment>())); }
public void CreateComment_Success(Comment comment) { // Arrange var repository = new TestSetup().SetupRepository(); // Act repository.CreateComment(comment).Wait(); // Assert CollectionAssert.IsNotEmpty(repository.Storage); Assert.AreNotEqual(default(int), comment.CommentId); Assert.AreNotEqual(default(DateTime), comment.CreationDate); }