public void FriendListLinkIsInvalid() { // Create a new friend list link with bad data. var friendListLink = new FriendListLink { Id = int.MaxValue }; // Get the number of errors in the model. Expecting 1 error. var errorcount = ValidateModel(friendListLink).Count; // There should be an error. If there's not, something is wrong with validation. Assert.NotEqual(0, errorcount); }
public void FriendListLinkIsValid() { // Create a new friend list link with good data. var friendListLink = new FriendListLink { Id = int.MaxValue, UserId = int.MaxValue }; // Get the number of errors in the model. Expecting 0 errors. var errorcount = ValidateModel(friendListLink).Count; // No errors indicates that the model built without errors, and we like that. Assert.Equal(0, errorcount); }