public void Test_Error() { string path = this.GetFileInName("6-NoName.mp3"); IImportHelper iih = Substitute.For<IImportHelper>(); IImportContext iic = Substitute.For<IImportContext>(); PathTrackDescriptor target = new PathTrackDescriptor(path, iih, iic); string res = null; Action wl = () => res= target.Name; wl.ShouldThrow<Exception>(); }
public void Test() { IImportHelper iih = Substitute.For<IImportHelper>(); IImportContext iic = Substitute.For<IImportContext>(); iih.AlbumArtistClue.Returns("Artist"); iih.AlbumNameClue.Returns("Name"); PathTrackDescriptor target = new PathTrackDescriptor(_Path, iih, iic); IAlbumDescriptor ta = target; ta.Artist.Should().Be("Artist"); ta.Name.Should().Be("Name"); target.TrackNumber.Should().Be(5); target.Name.Should().Be("NoName"); using( Stream str = target.MusicStream()) { str.Should().NotBeNull(); } target.Dispose(); }