-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[2단계 - 자동차 경주 리팩터링] 야미(이다인) 미션 제출합니다. (#224)
* rename: rename folders * rename: rename folders removed all cache to enable case sensitivity in git * refactor: increase reusability of random number maker * refactor: remove useless code * test: create test code for random number maker * refactor: rename method * style: unify method style
- Loading branch information
Showing
16 changed files
with
62 additions
and
39 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const randomNumberBetween = require("../src/util/RandomNumberMaker"); | ||
|
||
test.each([ | ||
[0, 9], | ||
[1, 5], | ||
[2, 22], | ||
[3, 100], | ||
[4, 90], | ||
[5, 40], | ||
[6, 30], | ||
[7, 9], | ||
[8, 10], | ||
[9, 29], | ||
])("%i ~ %i 사이의 난수 반환", (min, max) => { | ||
expect(randomNumberBetween(min, max)).toBeGreaterThanOrEqual(min); | ||
expect(randomNumberBetween(min, max)).toBeLessThanOrEqual(max); | ||
}); |
This file contains 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 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 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 was deleted.
Oops, something went wrong.
This file contains 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 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
4 changes: 2 additions & 2 deletions
4
src/Domain/MovementIndicator.js → src/domain/MovementIndicator.js
This file contains 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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
const { MOVEMENT } = require("../Constants/Constants"); | ||
const { MOVEMENT } = require("../constant/Constants"); | ||
const { FORWARD_CONDITION_NUMBER, FORWARD_DISTANCE } = MOVEMENT; | ||
|
||
const movingDistance = (randomNumber) => { | ||
return randomNumber >= FORWARD_CONDITION_NUMBER ? FORWARD_DISTANCE : 0; | ||
}; | ||
|
||
module.exports = { movingDistance }; | ||
module.exports = movingDistance; |
This file contains 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const randomNumberBetween = (min, max) => { | ||
return Math.floor(Math.random() * (max - min + 1) + min); | ||
}; | ||
|
||
module.exports = randomNumberBetween; |
2 changes: 1 addition & 1 deletion
2
src/Utils/SplitAndTrimString.js → src/util/SplitAndTrimString.js
This file contains 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
File renamed without changes.
This file contains 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 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 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 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