public void Init() { var provider = new SampleAudioDramaProvider(); _audioDramas = provider.Get().ToList(); _searcher = new AudioDramaSearcher(); }
public void TheFilterReturnsOnlyAudioDramasThatHaveANumber() { var provider = new SampleAudioDramaProvider(); var filter = new MainAudioDramasOnlyFilter(); var filtered = filter.Filter(provider.Get().ToList()).ToList(); Assert.IsTrue(filtered.All(x => x.AudioDramaDto.NumberEuropa.HasValue)); }
public void TheFilterReturnsAllGivenAudioDramas() { var provider = new SampleAudioDramaProvider(); var audioDramas = provider.Get().ToList(); var filter = new AllAudioDramasFilter(); var filtered = filter.Filter(audioDramas).ToList(); CollectionAssert.AreEqual(audioDramas, filtered); }
public void TheSorterPutsAudioDramasMarkedAsFavoriteBeforeAudioDramasThatAreNot() { var provider = new SampleAudioDramaProvider(); var sorter = new IsFavoriteFirstSorter(); var audioDramas = provider.Get().ToList(); var expectedSort = audioDramas.OrderByDescending(x => x.AudioDramaUserData.IsFavorite).ToList(); var sort = sorter.Sort(audioDramas).ToList(); CollectionAssert.AreEqual(expectedSort, sort); }
public void FilterOnlyReturnsOnlyAudioDramasThatDontHaveANumber() { var provider = new SampleAudioDramaProvider(); var audioDramas = provider.Get().ToList(); var expectedFiltered = audioDramas.Where(x => x.AudioDramaDto.NumberEuropa.HasValue == false).ToList(); var filter = new SpecialAudioDramasOnlyFilter(); var filtered = filter.Filter(audioDramas).ToList(); CollectionAssert.AreEqual(expectedFiltered, filtered); }
public void TheSorterSortsDescendingByReleaseDate_NewBeforeOld() { var provider = new SampleAudioDramaProvider(); var sorter = new ReleaseDateDescendingSorter(); var audioDramas = provider.Get().ToList(); var expectedSort = audioDramas.OrderByDescending(x => x.AudioDramaDto.ReleaseDate).ToList(); var sort = sorter.Sort(audioDramas).ToList(); CollectionAssert.AreEqual(expectedSort, sort); }
public void TheSorterSortsTheAudioDramasDescendingByTheirNumber() { var provider = new SampleAudioDramaProvider(); var sorter = new NumberDescendingSorter(); var audioDramas = provider.Get().ToList(); var expectedSort = audioDramas.OrderByDescending(x => x.AudioDramaDto.NumberEuropa).ToList(); var sort = sorter.Sort(audioDramas).ToList(); CollectionAssert.AreEqual(expectedSort, sort); }
public void TheSorterPutsAudioDramasMarkedAsHeardBeneathUnheardAudioDramas() { var provider = new SampleAudioDramaProvider(); var sorter = new HeardLastSorter(); var audioDramas = provider.Get().ToList(); var expectedSort = audioDramas.OrderBy(x => x.AudioDramaUserData.Heard).ToList(); var sort = sorter.Sort(audioDramas).ToList(); CollectionAssert.AreEqual(expectedSort, sort); }
public void TheSorterSortsTheAudioDramasAscendingByName() { var provider = new SampleAudioDramaProvider(); var sorter = new NameAscendingSorter(); var audioDramas = provider.Get().ToList(); var expectedSort = audioDramas.OrderBy(x => x.AudioDramaDto.Title).ToList(); var sort = sorter.Sort(audioDramas).ToList(); CollectionAssert.AreEqual(expectedSort, sort); }
public void TheSorterPutsHeardAudioDramasBeforeUnheardAudioDramas() { var provider = new SampleAudioDramaProvider(); var sorter = new HeardFirstSorter(); var audioDramas = provider.Get().ToList(); var expectedSort = audioDramas.OrderByDescending(x => x.AudioDramaUserData.Heard).ToList(); var sort = sorter.Sort(audioDramas).ToList(); CollectionAssert.AreEqual(expectedSort, sort); }
public void TheFilterReturnsOnlyAudioDramasThatAreMarkedAsFavorite() { var provider = new SampleAudioDramaProvider(); var audioDramas = provider.Get().ToList(); var filter = new FavoritesOnlyFilter(); var expectedFiltering = audioDramas.Where(x => x.AudioDramaUserData.IsFavorite).ToList(); var filtered = filter.Filter(audioDramas).ToList(); CollectionAssert.AreEqual(expectedFiltering, filtered); }
public void FilterReturnsOnlyUnheardAudioDramas() { var provider = new SampleAudioDramaProvider(); var audioDramas = provider.Get().ToList(); var expectedFiltered = audioDramas.Where(x => x.AudioDramaUserData.Heard == false).ToList(); var filter = new UnheardOnlyFilter(); var filtered = filter.Filter(audioDramas).ToList(); CollectionAssert.AreEqual(expectedFiltered, filtered); }
public void TheFilterReturnsOnlyAudioDramasWhereTheInterpreterIsDieDreiFragezeichen() { var provider = new SampleAudioDramaProvider(); var audioDramas = provider.Get().ToList(); var audioDrama = audioDramas.First(); audioDrama.AudioDramaDto.Interpreter = "Homer Simpson"; var filter = new DieDreiFrageichenOnlyFilter(); var expectedFiltering = audioDramas.Where(x => x.AudioDramaDto.Interpreter == "Die drei ???").ToList(); var filtered = filter.Filter(audioDramas).ToList(); Assert.IsFalse(filtered.Contains(audioDrama)); CollectionAssert.AreEqual(expectedFiltering, filtered); }
public void TheFilterReturnsOnlyAudioDramasWhereTheInterpreterIsDieDrei() { var provider = new SampleAudioDramaProvider(); var audioDramas = provider.Get().ToList(); var audioDrama = audioDramas.First(); audioDrama.AudioDramaDto.Interpreter = "DiE DR3i"; var filter = new DieDreiFilter(); var expectedFiltering = audioDramas.Where(x => x.AudioDramaDto.Interpreter == "DiE DR3i").ToList(); var filtered = filter.Filter(audioDramas).ToList(); Assert.IsTrue(filtered.Contains(audioDrama)); CollectionAssert.AreEqual(expectedFiltering, filtered); }