Skip to content

Commit

Permalink
test(enharmonic_interval): add test cases for transposeBy
Browse files Browse the repository at this point in the history
  • Loading branch information
albertms10 committed Apr 9, 2023
1 parent 71f84e2 commit 5f49f4b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/src/interval/enharmonic_interval_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,30 @@ void main() {
});
});

group('.transposeBy()', () {
test(
'should return the transposed EnharmonicInterval by semitones',
() {
expect(
const EnharmonicInterval(1).transposeBy(2),
const EnharmonicInterval(3),
);
expect(
const EnharmonicInterval(6).transposeBy(-3),
const EnharmonicInterval(3),
);
expect(
const EnharmonicInterval(8).transposeBy(6),
const EnharmonicInterval(2),
);
expect(
const EnharmonicInterval(4).transposeBy(-6),
const EnharmonicInterval(10),
);
},
);
});

group('.hashCode', () {
test('should ignore equal EnharmonicInterval instances in a Set', () {
final collection = {
Expand Down

0 comments on commit 5f49f4b

Please sign in to comment.