Skip to content

Commit

Permalink
test(interval): add test cases for inverted (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
albertms10 authored Apr 15, 2023
1 parent d8b80b6 commit ba43eba
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/src/interval/int_interval_extension_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,16 @@ void main() {
expect(13.simplified, 6);
});
});

group('.inverted', () {
test('should return the inverted int interval', () {
expect(2.inverted, 7);
expect(4.inverted, 5);
expect(8.inverted, 1);
expect(9.inverted, 7);
expect(10.inverted, 6);
expect(13.inverted, 3);
});
});
});
}
29 changes: 29 additions & 0 deletions test/src/interval/interval_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,35 @@ void main() {
});
});

group('.inverted', () {
test('should return the inverted of this Interval', () {
expect(
const Interval.perfect(1, PerfectQuality.augmented).inverted,
const Interval.perfect(8, PerfectQuality.diminished),
);
expect(
const Interval.perfect(1, PerfectQuality.perfect).inverted,
const Interval.perfect(8, PerfectQuality.perfect),
);
expect(
const Interval.imperfect(2, ImperfectQuality.major).inverted,
const Interval.imperfect(7, ImperfectQuality.minor),
);
expect(
const Interval.imperfect(3, ImperfectQuality.minor).inverted,
const Interval.imperfect(6, ImperfectQuality.major),
);
expect(
const Interval.perfect(5, PerfectQuality.diminished).inverted,
const Interval.perfect(4, PerfectQuality.augmented),
);
expect(
const Interval.perfect(4, PerfectQuality.diminished).inverted,
const Interval.perfect(5, PerfectQuality.augmented),
);
});
});

group('.toString()', () {
test('should return the string representation of this Interval', () {
expect(
Expand Down

0 comments on commit ba43eba

Please sign in to comment.