RED: test roman numerals contraints
This commit is contained in:
parent
5dfc85fc20
commit
216aa72d39
1 changed files with 14 additions and 0 deletions
|
|
@ -66,5 +66,19 @@ void main() {
|
|||
() => expect(integerToRoman(3999), 'MMMCMXCIX'),
|
||||
);
|
||||
});
|
||||
|
||||
group('Error Handling', () {
|
||||
test('rejects zero', () {
|
||||
expect(() => integerToRoman(0), throwsArgumentError);
|
||||
});
|
||||
|
||||
test('rejects negative numbers', () {
|
||||
expect(() => integerToRoman(-5), throwsArgumentError);
|
||||
});
|
||||
|
||||
test('rejects numbers above 3999', () {
|
||||
expect(() => integerToRoman(4000), throwsArgumentError);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue