public MusicPlayer CreateMusicPlayer(out IInternalTrack it, out IInternalPlayer iip, out IReadOnlyPlayList irop) { //arrange IMusicFactory imf = Substitute.For<IMusicFactory>(); iip = Substitute.For<IInternalPlayer>(); imf.GetInternalPlayer().Returns(iip); iip.FileSource = null; irop = Substitute.For<IReadOnlyPlayList>(); it = Substitute.For<IInternalTrack>(); it.Path.Returns("MyPath"); irop.CurrentTrack.Returns(it); MusicPlayer res = new MusicPlayer(imf); res.PlayList = irop; return res; }
internal static void ChangeCurrent(this IReadOnlyPlayList @this, IInternalTrack iit) { @this.CurrentTrack.Returns(iit); @this.SelectionChanged += Raise.EventWith(new SelectionChangedargs()); }