-
-
Notifications
You must be signed in to change notification settings - Fork 397
London | 26-ITP-May | Damilola Odumosu| Sprint 3 | coursework #1528
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
Open
d-odumosu
wants to merge
20
commits into
CodeYourFuture:main
Choose a base branch
from
d-odumosu:coursework/sprint-3-implement-and-rewrite
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
4ea74f5
function and assertion tests completed
d-odumosu ecd12aa
reformatted
d-odumosu a4ba8bc
added more test cases to cover all boundaries
d-odumosu 822fcbc
implemented the function and added test cases to cover all boundaries
d-odumosu 1a96b7d
completed and tested card game
d-odumosu c727523
adding additional test
d-odumosu 62aab55
all jest tests pass in 1-angle-type.js
d-odumosu 09fe227
all jest tests pass in 2-is-proper-fraction.js
d-odumosu 8270fd6
refactored
d-odumosu f092667
completed jest testing on card game and proper fractions
d-odumosu 4e5fb74
is proper fraction has been reimplemented to correctly
d-odumosu 95828f5
simplified the use of .slice
d-odumosu a8c0c3b
changed error message for invalid suit
d-odumosu 4eb7cd7
refactored: removed redundant code
d-odumosu 48814ec
changed test describtion to be more clear
d-odumosu c4f94e6
reimplemented the tests for the function change in proper fraction.
d-odumosu d59acfe
changes made to the notation 0 > angle > 360
d-odumosu 70ebf35
changes made to angle test
d-odumosu 0b216f8
changes made to angle test
d-odumosu 3e139b5
test description changed to match the test
d-odumosu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,19 +2,35 @@ | |
| // We will use the same function, but write tests for it using Jest in this file. | ||
| const getAngleType = require("../implement/1-get-angle-type"); | ||
|
|
||
| // TODO: Write tests in Jest syntax to cover all cases/outcomes, | ||
| // including boundary and invalid cases. | ||
|
|
||
| // Case 1: Acute angles | ||
| test(`should return "Acute angle" when (0 < angle < 90)`, () => { | ||
| // Test various acute angles, including boundary cases | ||
| test(`should return "Acute angle" when angle is greater than 0 or angle is less than 90')`, () => { | ||
| expect(getAngleType(1)).toEqual("Acute angle"); | ||
| expect(getAngleType(45)).toEqual("Acute angle"); | ||
| expect(getAngleType(89)).toEqual("Acute angle"); | ||
| }); | ||
|
|
||
| // Case 2: Right angle | ||
| // Case 3: Obtuse angles | ||
| // Case 2: Obtuse angle | ||
| test(`should return "obtuse angle" when angle is greater than 90 but less than 180 `, () => { | ||
| expect(getAngleType(91)).toEqual("Obtuse angle"); | ||
| expect(getAngleType(179)).toEqual("Obtuse angle"); | ||
| }); | ||
| // Case 3: Right angles | ||
| test(`should return "Right angle" when (angle === 90)`, () => { | ||
| expect(getAngleType(90)).toEqual("Right 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 "Reflect angle" when angle is greater than 180 but less than 360))`, () => { | ||
| expect(getAngleType(181)).toEqual("Reflex angle"); | ||
| expect(getAngleType(359)).toEqual("Reflex angle"); | ||
| }); | ||
| // Case 6: Invalid angles | ||
| test(`"should return 'Invalid angle' when angle is 0, 360, less than 0, or greater than 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. We could also use math notations or pseudo code in the description to keep the description concise. |
||
| expect(getAngleType(0)).toEqual("Invalid angle"); | ||
| expect(getAngleType(360)).toEqual("Invalid angle"); | ||
| expect(getAngleType(-1)).toEqual("Invalid angle"); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could consider organizing the code in this manner (esp. when the invalid cases can be determined easily):
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.
all changes have been made, thank you