public async Task ReplyId_Is_Empty() { // Setup var commentsStorageMock = new Mock <ICommentsStorage>(); var validator = new CommentReplyValidator(commentsStorageMock.Object); var comment = new Comment(string.Empty, string.Empty, DateTimeOffset.Now, string.Empty, replyCommentId: null, null); // Act var result = await validator.ValidateAsync(comment); // Assert Assert.IsTrue(result.Successed); }
public async Task ReplyId_Is_Empty() { // Setup var commentsStorageMock = new Mock <ICommentsStorage>(); var validator = new CommentReplyValidator(commentsStorageMock.Object); var context = new CommentContext("Hello_Hello"); // Act var result = await validator.ValidateAsync(context); // Assert Assert.IsTrue(result.Successed); }
public async Task ReplyId_Does_Not_Exists() { // Setup var commentsStorageMock = new Mock <ICommentsStorage>(); commentsStorageMock .Setup(s => s.FindOneByIdAsync("replyId")) .ReturnsAsync(default(Comment)); var validator = new CommentReplyValidator(commentsStorageMock.Object); var comment = new Comment(string.Empty, string.Empty, DateTimeOffset.Now, string.Empty, replyCommentId: "replyId", null); // Act var result = await validator.ValidateAsync(comment); // Assert Assert.IsFalse(result.Successed); }
public async Task ReplyId_Does_Not_Exists() { // Setup var commentsStorageMock = new Mock <ICommentsStorage>(); commentsStorageMock .Setup(s => s.FindOneByIdAsync("replyId")) .ReturnsAsync(default(Comment)); var validator = new CommentReplyValidator(commentsStorageMock.Object); var context = new CommentContext("Hello_Hello", "replyId"); // Act var result = await validator.ValidateAsync(context); // Assert Assert.IsFalse(result.Successed); }