/// <summary>
        /// 演奏します。
        /// </summary>
        /// <param name="dynamics">強弱</param>
        public void Play(string dynamics)
        {
            switch (dynamics)
            {
            case "pp":
                _currentPlay = new Dynamics.Pianissimo();
                break;

            case "p":
                _currentPlay = new Dynamics.Piano();
                break;

            case "f":
                _currentPlay = new Dynamics.Forte();
                break;

            case "ff":
                _currentPlay = new Dynamics.Fortessimo();
                break;

            default:     //他の強弱記号あるけど、めんどくさいので省略
                break;
            }
            _currentPlay.Play();
        }
        private void IPlayBaseTest(IPlay device, string expectedResult, FakeOutput output)
        {
            //-- Act
            device.Play(new Track());

            //-- Assert
            Assert.AreEqual(output.Result, expectedResult);
        }
Esempio n. 3
0
 public void Play()
 {
     if (m_advertisement != null)
     {
         m_advertisement.ShowAdvertisement();
         m_player.Play();
     }
 }
 public void Play()
 {
     if (m_copyRightMark != null)
     {
         m_copyRightMark.ShowCopyRight();
         m_player.Play();
     }
 }
Esempio n. 5
0
        public void ExternalSpeakerTest()
        {
            output          = new FakeOutput();
            device          = new ExternalSpeaker(new RealSpeaker(2), 20, output);
            expectedMessage = $"{nameof(ExternalSpeaker)} sound";

            //-- Act
            device.Play(new Track());

            //-- Assert
            Assert.AreEqual(output.Result, expectedMessage);
        }
Esempio n. 6
0
        public void SamsungHeadsetTest()
        {
            output          = new FakeOutput();
            device          = new SamsungHeadset(new RealSpeaker(2), new RealSpeaker(2), 20, output);
            expectedMessage = $"{nameof(SamsungHeadset)} sound";

            //-- Act
            device.Play(new Track());

            //-- Assert
            Assert.AreEqual(output.Result, expectedMessage);
        }
Esempio n. 7
0
File: Form1.cs Progetto: imrole/c-
 private void button5_Click(object sender, EventArgs e)
 {
     label1.Text = ip.Play();
 }
Esempio n. 8
0
 public string Category()
 {
     return(_play.Play());
 }