Skip to content

Commit

Permalink
test(enharmonic): move toString test cases to each implementation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
albertms10 committed May 22, 2023
1 parent b6f1add commit 4bb96ec
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 24 deletions.
22 changes: 0 additions & 22 deletions test/src/enharmonic_test.dart

This file was deleted.

15 changes: 15 additions & 0 deletions test/src/interval/enharmonic_interval_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,21 @@ void main() {
});
});

group('.toString()', () {
test(
'should return a string representation of this EnharmonicInterval',
() {
expect(EnharmonicInterval.perfectUnison.toString(), '0 {P1, d2}');
expect(EnharmonicInterval.majorThird.toString(), '4 {M3, d4}');
expect(EnharmonicInterval.minorSixth.toString(), '8 {A5, m6, dd7}');
expect(
(-EnharmonicInterval.majorSixth).toString(),
'desc 9 {desc d7, desc M6}',
);
},
);
});

group('.hashCode', () {
test('should ignore equal EnharmonicInterval instances in a Set', () {
final collection = {
Expand Down
2 changes: 0 additions & 2 deletions test/src/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'enharmonic_test.dart' as enharmonic_test;
import 'interval/enharmonic_interval_test.dart' as enharmonic_interval_test;
import 'interval/interval_size_extension_test.dart'
as interval_size_extension_test;
Expand All @@ -18,7 +17,6 @@ import 'tonality/mode_test.dart' as mode_test;
import 'tonality/tonality_test.dart' as tonality_test;

void main() {
enharmonic_test.main();
enharmonic_interval_test.main();
interval_size_extension_test.main();
interval_test.main();
Expand Down
8 changes: 8 additions & 0 deletions test/src/note/enharmonic_note_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,14 @@ void main() {
});
});

group('.toString()', () {
test('should return a string representation of this EnharmonicNote', () {
expect(EnharmonicNote.c.toString(), '1 {C, D𝄫, B♯}');
expect(EnharmonicNote.g.toString(), '8 {F𝄪, G, A𝄫}');
expect(EnharmonicNote.dSharp.toString(), '4 {D♯, E♭}');
});
});

group('.hashCode', () {
test('should ignore equal EnharmonicNote instances in a Set', () {
final collection = {EnharmonicNote.f, EnharmonicNote.aSharp};
Expand Down

0 comments on commit 4bb96ec

Please sign in to comment.