public void Can_build_valid_library_from_xml() { var xElements = new List<XElement> { new XElement("plist", new XElement("dlist", new XElement("artist", "billy idol"))) }; var lb = new LibraryBuilder<XElement>(); IEnumerable<XElement> buildLibrary = lb.BuildLibrary(xElements); Assert.That(buildLibrary, Is.Not.Null); Assert.That(buildLibrary.Count(), Is.GreaterThanOrEqualTo(1)); }
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 Can_build_valid_library_from_xml_file() { var xElements = new List<XElement>{new XElement("plist", new XElement("dlist", new XElement("artist", "billy idol")))}; var libraryParser = MockRepository.GenerateStub<ILibraryParser>(); libraryParser.Stub(x => x.ParseXml(Arg<string>.Is.Anything)).Return(xElements); var lb = new LibraryBuilder<XElement>(libraryParser); IEnumerable<XElement> buildLibrary = lb.BuildLibrary(""); Assert.That(buildLibrary, Is.Not.Null); Assert.That(buildLibrary.Count(), Is.GreaterThanOrEqualTo(1)); }