-
-
Notifications
You must be signed in to change notification settings - Fork 391
London | 26-ITP-May | Liridona Shehu | Sprint 3 | Implement and rewrite #1474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
7fd7710
88d76b4
b6def45
d06f9a3
c15a48e
66ddc97
b82f302
491605b
b8a684c
095f72d
0a4c587
4aa639f
892bb92
4bc146e
4ccf833
4b20e69
6f270d2
0799ea5
956f635
5cec9c4
1096cc2
6caf04c
fdd00ab
31e40fa
68ce473
bfe4374
188448b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,8 +13,43 @@ test(`should return "Acute angle" when (0 < angle < 90)`, () => { | |
| expect(getAngleType(89)).toEqual("Acute angle"); | ||
| }); | ||
|
|
||
|
|
||
| // Case 2: Right angle | ||
| test(`should return "Right angle" when ( angle = 90)`, () => { | ||
| // Test various right angles, including boundary cases | ||
| expect(getAngleType(90)).toEqual("Right angle"); | ||
|
|
||
| }); | ||
|
|
||
|
|
||
| // Case 3: Obtuse angles | ||
| test(`should return "Obtuse angle" when (90 < angle < 180)`, () => { | ||
| // Test various obtuse angles, including boundary cases | ||
| expect(getAngleType(91)).toEqual("Obtuse angle"); | ||
| expect(getAngleType(120)).toEqual("Obtuse angle"); | ||
| expect(getAngleType(179)).toEqual("Obtuse angle"); | ||
| }); | ||
|
|
||
|
|
||
| // Case 4: Straight angle | ||
| test(`should return "Straight angle" when ( angle = 180)`, () => { | ||
| // Test various straight angles, including boundary cases | ||
| expect(getAngleType(180)).toEqual("Straight angle"); | ||
| }); | ||
|
|
||
|
|
||
| // Case 5: Reflex angles | ||
| test(`should return "Reflex angle" when (180 < angle < 360)`, () => { | ||
| // Test various reflex angles, including boundary cases | ||
| expect(getAngleType(181)).toEqual("Reflex angle"); | ||
| expect(getAngleType(220)).toEqual("Reflex angle"); | ||
| expect(getAngleType(359)).toEqual("Reflex angle"); | ||
| }); | ||
|
|
||
|
|
||
| // Case 6: Invalid angles | ||
| test(`should return "Invalid angle" when (180 < angle < 360)`, () => { | ||
| // Test various invalid angles, including boundary cases | ||
| expect(getAngleType(0)).toEqual("Invalid angle"); | ||
| expect(getAngleType(360)).toEqual("Invalid angle"); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could add 2 test cases that are not boundary cases
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added more test cases that are not boundary cases. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which test cases did you add? I do not see any new ones. |
||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats a nice way of checking if the input is valid. By expliciting stating all allowed values that code is easy to understand