Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/test/java/racingcar/ApplicationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import camp.nextstep.edu.missionutils.test.NsTest;
import org.junit.jupiter.api.Test;

import camp.nextstep.edu.missionutils.Randoms;

import static camp.nextstep.edu.missionutils.test.Assertions.assertRandomNumberInRangeTest;
import static camp.nextstep.edu.missionutils.test.Assertions.assertSimpleTest;
import static org.assertj.core.api.Assertions.assertThat;
Expand Down Expand Up @@ -36,3 +38,23 @@ public void runMain() {
Application.main(new String[]{});
}
}

class car {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

클래스는 '테스트', '자동차' 등 객체나 특정 단위에 따라 분리해보시길 바랍니다.

private String name;
private int position;

car(String name){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

클래스나 멤버변수, 메서드 앞에 오는 public, private, default 등이 어떤 역할을 할까요?

힌트: 접근제어자

this.name = name;
this.position = 0;
}

private int ran() {
return Randoms.pickNumberInRange(0, 9);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

들여쓰기가 빠졌어요

}

void move(){
if(ran() >= 4){position += 1;}
}
String getname(){return name;}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

개행을 통일하면 좋을 것 같습니다


}