-
-
Notifications
You must be signed in to change notification settings - Fork 335
Manchester | ITP-JAN-26 | Ofonime Edak | Sprint 3 | Coursework/sprint 3 implement and rewrite #1139
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 4 commits
5209d8d
49570d3
0ee00b9
d1394c1
815a1c8
865cf09
b1a1d5e
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 |
|---|---|---|
|
|
@@ -14,7 +14,40 @@ test(`should return "Acute angle" when (0 < angle < 90)`, () => { | |
| }); | ||
|
|
||
| // Case 2: Right angle | ||
| test(`should return "Right Angles" when(angle===90)`, () => { | ||
| expect(getAngleType(90)).toEqual("Right angle"); | ||
| }); | ||
|
|
||
| // Case 3: Obtuse angles | ||
|
|
||
| test(`should return "Obtuse angles" when (90< angle <180)`, () => { | ||
| expect(getAngleType(91)).toEqual("Obtuse angle"); | ||
| expect(getAngleType(179)).toEqual("Obtuse angle"); | ||
| expect(getAngleType(160)).toEqual("Obtuse angle"); | ||
| expect(getAngleType(100)).toEqual("Obtuse angle"); | ||
| expect(getAngleType(151.55)).toEqual("Obtuse angle"); | ||
| }); | ||
|
|
||
| // Case 4: Straight angle | ||
| test(`should return "Straight angle" when (angle===180)`, () => { | ||
| expect(getAngleType(180).toEqual("Straight angle")); | ||
| }); | ||
|
|
||
| // Case 5: Reflex angles | ||
| test(`Should return "Reflex angle" when (180>angle<360)`, () => { | ||
|
||
| expect(getAngleType(181)).toEqual("Reflex angle"); | ||
| expect(getAngleType(270)).toEqual("Reflex angle"); | ||
| expect(getAngleType(350)).toEqual("Reflex angle"); | ||
| expect(getAngleType(359.5)).toEqual("Reflex angle"); | ||
| expect(getAngleType(210)).toEqual("Reflex angle"); | ||
| expect(getAngleType(200)).toEqual("Reflex angle"); | ||
| }); | ||
|
|
||
| // Case 6: Invalid angles | ||
| test(`Should return "Invalid angle" when (0 =<angle>=360)`, () => { | ||
|
Contributor
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. How about |
||
| expect(getAngleType(0).toEqual("Invalid angle")); | ||
| expect(getAngleType(-1).toEqual("Invalid angle")); | ||
| expect(getAngleType(360).toEqual("Invalid angle")); | ||
| expect(getAngleType(500).toEqual("Invalid angle")); | ||
| expect(getAngleType("1e5").toEqual("Invalid angle")); | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,4 +7,10 @@ const isProperFraction = require("../implement/2-is-proper-fraction"); | |
| // Special case: numerator is zero | ||
| test(`should return false when denominator is zero`, () => { | ||
| expect(isProperFraction(1, 0)).toEqual(false); | ||
| expect(isProperFraction(1, -1)).toEqual(false); | ||
| expect(isProperFraction(10, 1)).toEqual(false); | ||
| expect(isProperFraction(1, 10)).toEqual(true); | ||
| expect(isProperFraction(-1, 0)).toEqual(true); | ||
| expect(isProperFraction(1e2, 1e4)).toEqual(true); | ||
| expect(isProperFraction(1e4, 1e0)).toEqual(false); | ||
| }); | ||
|
Contributor
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. These data categories and samples are not comprehensive enough. You should test also those proper and improper fraction samples you had in
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. Alright, I will improve the test case. Thank you very much |
||
Uh oh!
There was an error while loading. Please reload this page.