public void PlayMusicAndVideo() { MockSoundDevice device = new MockSoundDevice(); Assert.IsTrue(device.IsInitialized); var music1 = ContentLoader.Load<Music>("DefaultMusic"); music1.Play(); Assert.False(MockMusic.MusicStopCalled); device.RegisterCurrentMusic(music1); Assert.IsTrue(device.IsActive); Assert.IsTrue(device.IsInitialized); device.RapidUpdate(); device.Dispose(); }
public void PlayAndStopMusic() { MockSoundDevice device = new MockSoundDevice(); Assert.IsTrue(device.IsPauseable); Assert.IsTrue(device.IsInitialized); var musicTime = ContentLoader.Load<Music>("DefaultMusic"); musicTime.StreamFinished = () => { }; musicTime.Play(); device.RegisterCurrentMusic(musicTime); musicTime.Stop(); device.RapidUpdate(); musicTime.Loop = true; musicTime.Stop(); device.RapidUpdate(); device.Dispose(); }
public void ChangeMusicVolume() { var device = new MockSoundDevice(); float defaultMusicVolume = Settings.Current.MusicVolume; Assert.IsTrue(device.IsInitialized); try { device.MusicVolume = 1.0f; Assert.AreEqual(1.0f, device.MusicVolume); } finally { device.MusicVolume = defaultMusicVolume; } device.RapidUpdate(); device.Dispose(); }