-
-
Notifications
You must be signed in to change notification settings - Fork 117
ITP JAN 2025 LONDON| ELFREDAH KEVIN-ALERECHI| Module-Structuring-and-Testing-Data | Sprint 3 #444
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
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 |
---|---|---|
|
@@ -43,14 +43,17 @@ assertEquals(acute, "Acute angle"); | |
// When the angle is greater than 90 degrees and less than 180 degrees, | ||
// Then the function should return "Obtuse angle" | ||
const obtuse = getAngleType(120); | ||
// ====> write your test here, and then add a line to pass the test in the function above | ||
// ====> const obtuse = getAngleType(120); | ||
//assertEquals(obtuse, "Obtuse angle"); | ||
|
||
// Case 4: Identify Straight Angles: | ||
// When the angle is exactly 180 degrees, | ||
// Then the function should return "Straight angle" | ||
// ====> write your test here, and then add a line to pass the test in the function above | ||
// ====> const straight = getAngleType(180); | ||
//assertEquals(straight, "Straight angle"); | ||
|
||
// Case 5: Identify Reflex Angles: | ||
// When the angle is greater than 180 degrees and less than 360 degrees, | ||
// Then the function should return "Reflex angle" | ||
// ====> write your test here, and then add a line to pass the test in the function above | ||
// ====> const straight = getAngleType(180); | ||
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. shouldn't the test cover angles greater that 180 degrees and less than 360 degrees. |
||
//assertEquals(straight, "Straight angle"); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,14 +40,33 @@ assertEquals(improperFraction, false); | |
// target output: true | ||
// Explanation: The fraction -4/7 is a proper fraction because the absolute value of the numerator (4) is less than the denominator (7). The function should return true. | ||
const negativeFraction = isProperFraction(-4, 7); | ||
// ====> complete with your assertion | ||
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. I think this is incomplete |
||
// ====> const equalFraction = isProperFraction(3, 3); | ||
assertEquals(equalFraction, false); | ||
|
||
|
||
// Equal Numerator and Denominator check: | ||
// Input: numerator = 3, denominator = 3 | ||
// target output: false | ||
// Explanation: The fraction 3/3 is not a proper fraction because the numerator is equal to the denominator. The function should return false. | ||
const equalFraction = isProperFraction(3, 3); | ||
// ====> complete with your assertion | ||
// ====> function isProperFraction(numerator, denominator) { | ||
if (denominator === 0) return "Undefined (denominator cannot be zero)"; // Handle division by zero | ||
return numerator < denominator; | ||
} | ||
|
||
// Helper function for assertions | ||
//function assertEquals(actualOutput, targetOutput) { | ||
//console.assert( | ||
// actualOutput === targetOutput, | ||
// `Expected ${actualOutput} to equal ${targetOutput}` | ||
// ); | ||
//} | ||
|
||
// Test for Equal Numerator and Denominator | ||
//const equalFraction = isProperFraction(3, 3); | ||
//assertEquals(equalFraction, false); | ||
|
||
|
||
// Stretch: | ||
// What other scenarios could you test for? | ||
//====>Test cases should include zero denominators, zero numerators, negative fractions, and improper fractions to ensure isProperFraction handles all scenarios correctly. |
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. Can you add some comment on what this countChar function is doing? |
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.
shouldn't the test cover angles greater that 90 degrees and and less than 180 degrees?