BalloonsPop.SoundPlayer.SoundsPlayer.RegisterSound C# (CSharp) Method

RegisterSound() public method

Caches a sound in the current instance.
public RegisterSound ( string soundName, System.Media.SoundPlayer player ) : void
soundName string
player System.Media.SoundPlayer
return void
        public void RegisterSound(string soundName, SoundPlayer player)
        {
            this.sounds.Add(soundName, player);
        }

Usage Example

Example #1
0
        public void SoundsShouldBeRegisteredProperlyToSoundsList()
        {
            SoundPlayer playerMedia = new SoundPlayer();
            SoundsLoader loader = new SoundsLoader();
            SoundsPlayer player = new SoundsPlayer(loader);

            player.RegisterSound("win", playerMedia);

            Assert.AreEqual(1, player.CountSounds());
        }