Beispiel #1
0
        public async Task Create_Tags_IgnoreCoverIfSongTypeIsCover()
        {
            var coverTag = _repository.Save(CreateEntry.Tag("cover"));

            _repository.Save(new TagMapping(coverTag, "cover"));
            _repository.Save(new EntryTypeToTagMapping(EntryTypeAndSubType.Create(EntryType.Song, SongType.Cover), coverTag));

            _pvParser.ResultFunc      = (url, meta) => CreateEntry.VideoUrlParseResultWithTitle(tags: new[] { "cover" });
            _newSongContract.SongType = SongType.Cover;

            var id = (await CallCreate()).Id;

            _song = _repository.Load(id);

            _song.SongType.Should().Be(SongType.Cover, "SongType");
            _song.Tags.Tags.Count().Should().Be(0, "No tags added");
        }
Beispiel #2
0
        public async Task GetTagSuggestions_IgnoreCoverTagIfTypeIsCover()
        {
            var coverTag = _repository.Save(CreateEntry.Tag("cover"));

            _repository.Save(new TagMapping(coverTag, "cover"));
            _repository.Save(new EntryTypeToTagMapping(EntryTypeAndSubType.Create(EntryType.Song, SongType.Cover), coverTag));

            _pvParser.ResultFunc = (url, meta) => CreateEntry.VideoUrlParseResultWithTitle(tags: new[] { "cover" });
            _song.SongType       = SongType.Cover;
            _song.PVs.Add(new PVForSong(_song, new PVContract {
                Service = PVService.NicoNicoDouga, PVType = PVType.Original, PVId = "sm393939"
            }));

            var result = await _queries.GetTagSuggestionsAsync(_song.Id);

            result.Count.Should().Be(0, "Cover tag suggestion ignored");
        }
Beispiel #3
0
 public static string TagUrlForEntryType <TSubType>(this UrlHelper urlHelper, EntryType entryType, TSubType subType)
     where TSubType : struct, Enum
 {
     return(TagUrlForEntryType(urlHelper, EntryTypeAndSubType.Create(entryType, subType)));
 }