public void EffectiveRoles_Custom() { var link = new ArtistForAlbum(album, artist, false, ArtistRoles.Mastering); Assert.AreEqual(ArtistRoles.Mastering, link.EffectiveRoles, "mastering role"); }
public AlbumForArtistEditContract(ArtistForAlbum artistForAlbum, ContentLanguagePreference languagePreference) { AlbumId = artistForAlbum.Album.Id; AlbumName = artistForAlbum.Album.TranslatedName[languagePreference]; AlbumAdditionalNames = string.Join(", ", artistForAlbum.Album.AllNames.Where(n => n != AlbumName)); ArtistForAlbumId = artistForAlbum.Id; }
public void EffectiveRoles_DefaultNoArtist() { var link = new ArtistForAlbum(album, "Miku!", false, ArtistRoles.Default); Assert.AreEqual(ArtistRoles.Default, link.EffectiveRoles, "default roles"); }
public void EffectiveRoles_Illustrator() { var link = new ArtistForAlbum(album, new Artist { ArtistType = ArtistType.Illustrator }, false, ArtistRoles.Default); Assert.AreEqual(ArtistRoles.Illustrator, link.EffectiveRoles, "illustrator has illustrator role"); }
public void EffectiveRoles_Illustrator() { var link = new ArtistForAlbum(_album, new Artist { ArtistType = ArtistType.Illustrator }, false, ArtistRoles.Default); link.EffectiveRoles.Should().Be(ArtistRoles.Illustrator, "illustrator has illustrator role"); }
public ArtistForAlbumForApiContract(ArtistForAlbum artistForAlbum, ContentLanguagePreference languagePreference) { ParamIs.NotNull(() => artistForAlbum); Artist = (artistForAlbum.Artist != null ? new ArtistContract(artistForAlbum.Artist, languagePreference) : null); Categories = artistForAlbum.ArtistCategories; EffectiveRoles = artistForAlbum.EffectiveRoles; IsSupport = artistForAlbum.IsSupport; Name = (Artist != null ? Artist.Name : artistForAlbum.Name); Roles = artistForAlbum.Roles; }
public ArchivedArtistForAlbumContract(ArtistForAlbum entry) { Roles = entry.Roles; IsSupport = entry.IsSupport; if (entry.Artist != null) { Id = entry.Artist.Id; NameHint = entry.Artist.DefaultName; } else { NameHint = entry.Name; } }
public ArtistForAlbumContract(ArtistForAlbum artistForAlbum, ContentLanguagePreference languagePreference) { ParamIs.NotNull(() => artistForAlbum); Artist = (artistForAlbum.Artist != null ? new ArtistContract(artistForAlbum.Artist, languagePreference) : null); Categories = artistForAlbum.ArtistCategories; EffectiveRoles = artistForAlbum.EffectiveRoles; Id = artistForAlbum.Id; IsCustomName = !string.IsNullOrEmpty(artistForAlbum.Name); IsSupport = artistForAlbum.IsSupport; Name = (Artist != null && !IsCustomName ? Artist.Name : artistForAlbum.Name); Roles = artistForAlbum.Roles; }
public virtual ArtistForAlbum AddAlbum(Album album, bool support, ArtistRoles roles) { ParamIs.NotNull(() => album); // Check is too slow for now //if (HasAlbum(album)) // throw new InvalidOperationException(string.Format("{0} has already been added for {1}", album, this)); var link = new ArtistForAlbum(album, this, support, roles); AllAlbums.Add(link); album.AllArtists.Add(link); return(link); }
public void SetUp() { _artistStringFactory = new ArtistStringFactory(); _circle = CreateArtist(ArtistType.Circle, "S.C.X."); _animator = CreateArtist(ArtistType.Animator, "wakamuraP"); _producer = CreateArtist(ArtistType.Producer, "devilishP"); _producer2 = CreateArtist(ArtistType.Producer, "40mP"); _producer3 = CreateArtist(ArtistType.Producer, "Clean Tears"); _producer4 = CreateArtist(ArtistType.Producer, "Tripshots"); _producers = new[] { _producer, _producer2, _producer3, _producer4 }; _vocalist = CreateArtist(ArtistType.Vocaloid, "Hatsune Miku"); _vocalist2 = CreateArtist(ArtistType.Vocaloid, "Kagamine Rin"); _vocalist3 = CreateArtist(ArtistType.Vocaloid, "Kagamine Len"); _vocalist4 = CreateArtist(ArtistType.Vocaloid, "Megurine Luka"); _vocalists = new[] { _vocalist, _vocalist2, _vocalist3, _vocalist4 }; }
public void EffectiveRoles_DefaultNoArtist() { var link = new ArtistForAlbum(_album, "Miku!", false, ArtistRoles.Default); link.EffectiveRoles.Should().Be(ArtistRoles.Default, "default roles"); }
public void EffectiveRoles_Custom() { var link = new ArtistForAlbum(_album, _artist, false, ArtistRoles.Mastering); link.EffectiveRoles.Should().Be(ArtistRoles.Mastering, "mastering role"); }