public void SoundOutBehaviour() { SoundOutTests((soundOut, source) => { source = new Utils.DisposableSource(source); Assert.AreEqual(PlaybackState.Stopped, soundOut.PlaybackState); soundOut.Initialize(source); Assert.AreEqual(PlaybackState.Stopped, soundOut.PlaybackState); soundOut.Play(); Assert.AreEqual(PlaybackState.Playing, soundOut.PlaybackState); Thread.Sleep(20); soundOut.Pause(); Assert.AreEqual(PlaybackState.Paused, soundOut.PlaybackState); Thread.Sleep(20); soundOut.Resume(); Assert.AreEqual(PlaybackState.Playing, soundOut.PlaybackState); Thread.Sleep(20); soundOut.Dispose(); Assert.IsFalse(((Utils.DisposableSource)source).IsDisposed, "{0} disposed source.", soundOut.GetType().FullName); }, true); }