public void TestFunc_UserIdsAreNotEqual_ShouldSetCanEditEqualToIsAdmin(string userId, bool isAdmin, int commentId, string content, string username) { // Arrange var comment = new Comment { UserId = userId, CommentId = commentId, Content = content, User = new User { UserName = username } }; // Act var model = CommentViewModel.FromComment(comment, null, isAdmin); // Assert Assert.AreEqual(isAdmin, model.CanEdit); }
public void TestFunc_ShouldSetCommentIdCorrectly(string userId, bool isAdmin, int commentId, string content, string username) { // Arrange var comment = new Comment { UserId = userId, CommentId = commentId, Content = content, User = new User { UserName = username } }; // Act var model = CommentViewModel.FromComment(comment, null, isAdmin); // Assert Assert.AreEqual(commentId, model.CommentId); }
public void TestFunc_ShouldSetDateCorrectly(string userId, bool isAdmin, int commentId, string content, string username) { // Arrange var date = new DateTime(); var comment = new Comment { Date = date, UserId = userId, CommentId = commentId, Content = content, User = new User { UserName = username } }; // Act var model = CommentViewModel.FromComment(comment, userId, isAdmin); // Assert Assert.AreEqual(date, model.Date); }