public void ShouldGetLikes() { //arrange var user = GenerateUser(); var userAnother = GenerateUser(); //act var dataLayer = new DataLayer.Sql.DataLayer(ConnectionSql); dataLayer.AddUser(user); dataLayer.AddUser(userAnother); var photo = GeneratePhoto(user.Id); dataLayer.AddPhoto(photo); dataLayer.AddLike(photo, user); dataLayer.AddLike(photo, userAnother); photo.UsersThatLike = dataLayer.GetLikes(photo); var resAllLikes = true; foreach (var usersLikes in photo.UsersThatLike) { if (usersLikes.Id != user.Id && usersLikes.Id != userAnother.Id) { resAllLikes = false; } } //assert Assert.AreEqual(resAllLikes, true); }