diff --git a/__tests__/LottoMachine.test.js b/__tests__/LottoMachine.test.js
index 12b42d68dc..37fbf0a9fa 100644
--- a/__tests__/LottoMachine.test.js
+++ b/__tests__/LottoMachine.test.js
@@ -2,16 +2,14 @@ import LottoMachine from '../src/Domain/LottoMachine';
import LOTTO_SETTING from '../src/Constants/lottoSetting';
describe('로또를 생성해주고 결과를 반환해주는 로또 머신 클래스에 대한 테스트', () => {
- test.each([[7000], [8000]])('구입금액에 해당하는 만큼 로또를 발행한다.', (validInput) => {
+ test.each([[7500], [8000]])('구입금액에 해당하는 만큼 로또를 발행한다.', (validInput) => {
// arrange
- const lottoMachine = new LottoMachine(validInput);
+ const lottoMachine = new LottoMachine();
- const totalLottoLength = lottoMachine.getLottos().length;
+ lottoMachine.makeLottoByMoney(validInput);
- expect(totalLottoLength).toBe(validInput / LOTTO_SETTING.MIN_PRICE);
- });
+ const boughtLottoLength = lottoMachine.getLottos().length;
- test.each([0, -1000, 999])('1000원 미만인 경우, (%i 인 경우) 에러를 던진다.', (money) => {
- expect(() => new LottoMachine(money)).toThrow();
+ expect(boughtLottoLength).toBe(Math.floor(validInput / LOTTO_SETTING.MIN_PRICE));
});
});
diff --git a/__tests__/Money.test.js b/__tests__/Money.test.js
new file mode 100644
index 0000000000..c8abb01930
--- /dev/null
+++ b/__tests__/Money.test.js
@@ -0,0 +1,19 @@
+import Money from '../src/Domain/Money.js';
+
+describe('돈을 담당하는 클래스에 관한 테스트 코드 작성', () => {
+ test.each([[1000], [8300]])('1000원 이상이 되는 금액을 투입 했을때, 1000으로 나눈 몫을 저장한다', (validInput) => {
+ const money = new Money();
+
+ money.receiveInjectionValue(validInput);
+
+ expect(money.getMoney()).toBe(validInput);
+ });
+
+ test('1000원 미만의 금액을 투입하면 예외 처리 한다.', () => {
+ const invalidInput = 999;
+
+ const money = new Money();
+
+ expect(() => money.receiveInjectionValue(invalidInput)).toThrow();
+ });
+});
diff --git a/docs/STEP2-READ-ME.md b/docs/STEP2-READ-ME.md
new file mode 100644
index 0000000000..27af7fcc7c
--- /dev/null
+++ b/docs/STEP2-READ-ME.md
@@ -0,0 +1,33 @@
+# STEP 2에 관한 README.md
+
+> [배포 링크](https://brgndyy.github.io/javascript-lotto/)
+
+## - 도메인
+
+### 1. Lotto
+
+단일 로또에 관한 클래스입니다. 숫자 6개를 받아서 숫자 배열로 관리해주는 기능을 합니다.
+
+### 2. LottoMachine
+
+금액을 입력 받아서, 구입 금액에 맞는 랜덤 로또를 발행해주는 기능을 합니다.
+
+또한 당첨 번호를 받아서, 1등부터 5등까지의 등수 결과 객체를 반환해줍니다.
+
+### 3. Money
+
+돈을 입력 받아서, 해당 구입금액에 대한 유효성을 검사합니다.
+
+### 4. RewardGenerator
+
+구매한 로또와 입력받은 당첨번호를 대조해보면서 각 매치카운트를 계산해서 1등부터 5등까지의 랭크를 지정합니다.
+
+### 5. WinningLotto
+
+당첨 번호, 보너스 번호를 입력받아서 관리합니다.
+
+---
+
+## - 레이아웃 구성
+
+
diff --git a/index.html b/index.html
index e083bc1cbb..e49699c1b9 100644
--- a/index.html
+++ b/index.html
@@ -5,12 +5,140 @@
🎱 행운의 로또
Document
+
+
+
+
+
+
+
+
+
+
+
+
-
-
🎱 행운의 로또
+
+
+
+
+
+
+
🎱 내 번호 당첨 확인 🎱
+
+
+
+
+
+
+
+
+
+
+
+ X
+
+
+ 🏆 당첨 통계 🏆
+
+
+
+ 일치 갯수 |
+ 당첨금 |
+ 당첨 갯수 |
+
+
+ 3개 |
+ 5,000 |
+ |
+
+
+ 4개 |
+ 50,000 |
+ |
+
+
+ 5개 |
+ 1,500,000 |
+ |
+
+
+ 5개+보너스볼 |
+ 30,000,000 |
+ |
+
+
+ 6개 |
+ 2,000,000,000 |
+ |
+
+
+
+
+
+
+
+
+
+
-
+
+