public void Should_return_1_song_based_on_name()
        {
            var librarybuilder = new LibraryBuilder<Song>();
            var selector = new SongSelector(librarybuilder);

            Song song = selector.FindSingle(x => x.Name == "Come Ray And Come Charles");

            Assert.IsNotNull(song);
            Assert.AreEqual("Come Ray And Come Charles", song.Name);
        }
        public void Should_return_null_if_no_songs_found()
        {
            Given_a_library_builder_with_no_songs();

            var selector = new SongSelector(_libraryBuilderStub);

            Song single = selector.FindSingle(x => x.Artist=="Never found");

            Assert.IsNull(single);
        }
        public void Should_return_songs_based_on_bitrate()
        {
            var librarybuilder = new LibraryBuilder<Song>();
            var selector = new SongSelector(librarybuilder);

            IEnumerable<Song> songs = selector.FindMany(x => x.BitRate > 40000);
            IEnumerable<Song> allSongs = librarybuilder.BuildLibrary(ConfigSettings.PathToXml);

            Assert.Greater(1, songs.Count());

            Assert.Less(songs.Count(), allSongs.Count());
        }
        public void Should_return_1_song()
        {
            const string expectedSong = "Be Somebody";

            Given_a_library_builder_with_multiple_songs();

            var selector = new SongSelector(_libraryBuilderStub);
            Song song = selector.FindSingle(x => x.Name == expectedSong);

            Assert.IsNotNull(song);
            Assert.AreEqual(expectedSong, song.Name);
        }
        public void Should_return_many_songs()
        {
            const string expected = "Interpol";

            Given_a_library_builder_with_multiple_songs();

            var selector = new SongSelector(_libraryBuilderStub);
            IEnumerable<Song> songs = selector.FindMany(x => x.Artist == "Interpol");

            Assert.IsNotEmpty(songs.ToList());

            Song first = songs.First();

            Assert.IsNotNull(first);
            Assert.AreEqual(expected, first.Artist);
        }