-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBookTest.java
More file actions
55 lines (41 loc) · 1.44 KB
/
Copy pathBookTest.java
File metadata and controls
55 lines (41 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package jp.co.training;
import static jp.co.training.Const.*;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import jp.co.training.book.Book;
import jp.co.training.command.CommandResult;
class BookTest {
@Nested
@DisplayName("validateメソッドのテスト")
class validateTest {
@Test
@DisplayName("ISBNの文字数チェックエラー")
void validateIsbnNG() {
Book book = new Book.Builder().isbn("12345678901234")
.bookName("社長も投票で決める会社をやってみた")
.author("武井 浩三")
.publisher("WAVE出版")
.publicationDate("20180423")
.price("1620").build();
CommandResult result = book.validate();
assertFalse(result.isExit());
assertEquals(1, result.getMesages().size());
assertEquals("ISBM:the length must be " + MAX_ISBN + " or less. but actual is 14.",
result.getMesages().get(0));
}
}
@Nested
@DisplayName("toStringメソッドのテスト")
class toStringTest {
}
@Nested
@DisplayName("Builderクラスのテスト")
class BuilderTest {
@Nested
@DisplayName("Buildメソッドのテスト")
class buildTest {
}
}
}