forked from code-differently/code-differently-24-q1
/
BookTest.java
29 lines (23 loc) · 901 Bytes
/
BookTest.java
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
package com.codedifferently.lesson9.LibraryManagementSystemTest;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.codedifferently.lesson9.LibraryManagementSystem.Book;
import org.junit.jupiter.api.Test;
/** Test class for the {@link com.codedifferently.lesson9.LibraryManagementSystem.Book} class. */
public class BookTest {
/** Test the constructor of the Book class. */
@Test
public void testBookConstructor() {
// Arrange
String title = "The Pragmatic Programmer";
String isbn = "9780135957059";
String author = "David Thomas, Andrew Hunt";
int numberOfPages = 320;
// Act
Book book = new Book(title, isbn, author, numberOfPages);
// Assert
assertEquals(title, book.getTitle());
assertEquals(isbn, book.getIsbn());
assertEquals(author, book.getAuthor());
assertEquals(numberOfPages, book.getNumberOfPages());
}
}