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)); }
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); }
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); }