private UserRating AddandGetTestUserRating() { var userRating = new UserRating { RaterUserID = 4, UserBeingRatedID = 3, Comment = "Test comment", RatingID = 5 }; using (var userRatingRepo = new UserRatingRepository(new brothershipEntities(ConnectionStrings.TEST_CONNECTION_STRING_NAME))) { userRatingRepo.Add(userRating); userRatingRepo.SaveChanges(); } return(userRating); }
public void Add_WasRatingAdded_ActualEqualsExpectedData() { var expectedUserRating = new UserRating { RaterUserID = 4, UserBeingRatedID = 3, Comment = "Test comment", RatingID = 5 }; UserRating actualUserRating; using (var userRatingRepo = new UserRatingRepository(new brothershipEntities(ConnectionStrings.TEST_CONNECTION_STRING_NAME))) { userRatingRepo.Add(expectedUserRating); userRatingRepo.SaveChanges(); actualUserRating = userRatingRepo.GetById(expectedUserRating.RaterUserID, expectedUserRating.UserBeingRatedID); } AssertUserRatingsEqual(expectedUserRating, actualUserRating); }