/// Tests the Key Functions /// @return True if all tests were executed, false if not bool KeySignatureTestSuite::TestCaseKey() { //------Last Checked------// // - Dec 11, 2004 KeySignature keySignature; TEST(wxT("SetKey - invalid key type"), !keySignature.SetKey(44, KeySignature::threeFlats)); TEST(wxT("SetKey - invalid key accidentals"), !keySignature.SetKey(KeySignature::minorKey, 44)); TEST(wxT("SetKey - valid"), keySignature.SetKey(KeySignature::minorKey, KeySignature::threeFlats) && (keySignature.GetKeyType() == KeySignature::minorKey) && (keySignature.GetKeyAccidentals() == KeySignature::threeFlats) ); // TEST CASE: IsSameKey { KeySignature keySignature(KeySignature::minorKey, KeySignature::threeFlats); keySignature.Show(); KeySignature keySignature2(KeySignature::minorKey, KeySignature::threeFlats); KeySignature keySignature3(KeySignature::majorKey, KeySignature::threeFlats); KeySignature keySignature4(KeySignature::minorKey, KeySignature::fourFlats); TEST(wxT("IsSameKey - true"), keySignature.IsSameKey(keySignature2)); TEST(wxT("IsSameKey - false"), !keySignature.IsSameKey(keySignature3)); TEST(wxT("IsSameKey - false"), !keySignature.IsSameKey(keySignature4)); } return (true); }
/// Tests the Show Functions /// @return True if all tests were executed, false if not bool KeySignatureTestSuite::TestCaseShow() { //------Last Checked------// // - Dec 11, 2004 KeySignature keySignature; keySignature.Show(); TEST(wxT("Show - true"), keySignature.IsShown()); keySignature.Hide(); TEST(wxT("Show - false"), !keySignature.IsShown()); return (true); }