Exemple #1
0
        public void Piano_Enable_WhenKeyDoesNotExist_ShouldDoNothing()
        {
            // Arrange
            Piano  p       = new Piano();
            int    oct     = Piano.BASE_OCTAAF + Piano.OCTAVEN;
            string letter  = "C";
            bool   special = false;

            // Act
            p.Enable(oct, letter, special);

            // Assert
            Assert.IsNull(p.FindKey(oct, letter, special));
        }
Exemple #2
0
        public void Piano_Enable_WhenKeyExists_ShouldSetEnabledToTrue()
        {
            // Arrange
            Piano  p       = new Piano();
            int    oct     = Piano.BASE_OCTAAF;
            string letter  = "C";
            bool   special = false;

            // Act
            p.Enable(oct, letter, special);

            // Assert
            PianoKey pk = p.FindKey(oct, letter, special);

            Assert.IsNotNull(pk);
            Assert.IsTrue(pk.Enabled);
        }
Exemple #3
0
        public void Piano_ResetAll()
        {
            // Arrange
            Piano  p       = new Piano();
            int    oct     = Piano.BASE_OCTAAF;
            string letter  = "C";
            bool   special = false;

            // Act
            p.Enable(oct, letter, special);
            p.ResetAll();

            // Asset
            PianoKey pk = p.FindKey(oct, letter, special);

            Assert.IsNotNull(pk);
            Assert.IsFalse(pk.Enabled);
        }