示例#1
0
        public void ClearRatings()
        {
            userWithEmail.AdditionalPermissions.Add(PermissionToken.DisableUsers);
            RefreshLoggedUser();
            var album = CreateEntry.Album();
            var song  = CreateEntry.Song();

            repository.Save(album);
            repository.Save(song);
            repository.Save(userWithoutEmail.AddAlbum(album, PurchaseStatus.Nothing, MediaType.DigitalDownload, 5));
            repository.Save(userWithoutEmail.AddSongToFavorites(song, SongVoteRating.Favorite));

            data.ClearRatings(userWithoutEmail.Id);

            Assert.AreEqual(0, userWithoutEmail.AllAlbums.Count, "No albums for user");
            Assert.AreEqual(0, userWithoutEmail.FavoriteSongs.Count, "No songs for user");
            Assert.AreEqual(0, album.UserCollections.Count, "Number of users for the album");
            Assert.AreEqual(0, song.UserFavorites.Count, "Number of users for the song");
            Assert.AreEqual(0, album.RatingTotal, "Album RatingTotal");
            Assert.AreEqual(0, song.RatingScore, "Song RatingScore");
        }