<commit_before>/**
 * 
 */
package com.project.bookshelf.test;

import com.project.bookshelf.model.Book;

import junit.framework.TestCase;

/**
 * @author Clay
 *
 */
public class BookTest extends TestCase {

	/**
	 * @param name
	 */
	public BookTest(String name) {
		super(name);
	}

	/* (non-Javadoc)
	 * @see junit.framework.TestCase#setUp()
	 */
	protected void setUp() throws Exception {
		super.setUp();
	}

	/* (non-Javadoc)
	 * @see junit.framework.TestCase#tearDown()
	 */
	protected void tearDown() throws Exception {
		super.tearDown();
	}

	/**
	 * Test method for {@link com.project.bookshelf.model.Book#Book()}.
	 */
	public void testBookShouldContructWhenEmpty() {
		Book book = new Book();
		
		assertNotNull("an empty Book should be able to be constructed", book);
	}

	/**
	 * Test method for {@link com.project.bookshelf.model.Book#Book(long, java.lang.String, java.lang.String, java.lang.String)}.
	 */
	public void testBookShouldConstructWithId() {
		long id = 1;
		String fileName = "file";
		String title = "title";
		String author = "author";
		
		Book book = new Book(id,fileName,title,author);
		assertNotNull("a Book should be able to be constructed with an id");
	}

	/**
	 * Test method for {@link com.project.bookshelf.model.Book#Book(java.lang.String, java.lang.String, java.lang.String)}.
	 */
	public void testBookShouldConstructWithoutId() {
		String fileName = "file";
		String title = "title";
		String author = "author";
		
		Book book = new Book(fileName,title,author);
		assertNotNull("a Book should be able to be constructed without an id");
	}

}<commit_msg>more rigorous testing of book model<commit_after>/**
 * 
 */
package com.project.bookshelf.test;

import com.project.bookshelf.model.Book;

import junit.framework.TestCase;

/**
 * @author Clay
 *
 */
public class BookTest extends TestCase {

	/**
	 * @param name
	 */
	public BookTest(String name) {
		super(name);
	}

	/* (non-Javadoc)
	 * @see junit.framework.TestCase#setUp()
	 */
	protected void setUp() throws Exception {
		super.setUp();
	}

	/* (non-Javadoc)
	 * @see junit.framework.TestCase#tearDown()
	 */
	protected void tearDown() throws Exception {
		super.tearDown();
	}

	/**
	 * Test method for {@link com.project.bookshelf.model.Book#Book()}.
	 */
	public void testBookShouldContructWhenEmpty() {
		Book book = new Book();
		
		assertNotNull("an empty Book should be able to be constructed", book);
	}

	/**
	 * Test method for {@link com.project.bookshelf.model.Book#Book(long, java.lang.String, java.lang.String, java.lang.String)}.
	 */
	public void testBookShouldConstructWithId() {
		long id = 1;
		String fileName = "file";
		String title = "title";
		String author = "author";
		
		Book book = new Book(id,fileName,title,author);
		assertNotNull("a Book should be able to be constructed with an id");
		assertTrue("A book constructed with id should set it properly",book.getId() == id);
		assertEquals("A book constructed with fileName should set it properly", book.getFileName(), fileName);
		assertEquals("A book constructed with title should set it properly", book.getTitle(), title);
		assertEquals("A book constructed with author should set it properly", book.getAuthor(),author);
		assertTrue("A book should be constructed with the default bookmark value of -1", book.getBookmark() == -1);
	}

	/**
	 * Test method for {@link com.project.bookshelf.model.Book#Book(java.lang.String, java.lang.String, java.lang.String)}.
	 */
	public void testBookShouldConstructWithoutId() {
		String fileName = "file";
		String title = "title";
		String author = "author";
		
		Book book = new Book(fileName,title,author);
		assertNotNull("a Book should be able to be constructed without an id");
		assertEquals("A book constructed with fileName should set it properly", book.getFileName(), fileName);
		assertEquals("A book constructed with title should set it properly", book.getTitle(), title);
		assertEquals("A book constructed with author should set it properly", book.getAuthor(),author);
		assertTrue("A book should be constructed with the default bookmark value of -1", book.getBookmark() == -1);
	}

}
{'fraction_non_alphanumeric': 0.13402811439650994, 'fraction_numerical': 0.001454192922927775, 'mean_word_length': 4.04523227383863, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7657434', 'n_tokens_mistral': 1329, 'n_tokens_neox': 1227, 'n_words': 371}