<commit_before>package com.twu.biblioteca;

import org.junit.Before;
import org.junit.Test;

import java.util.List;

import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsCollectionContaining.hasItem;
import static org.hamcrest.core.IsCollectionContaining.hasItems;

/**
 * Created by nataliadjohari on 21/02/2017.
 */
public class LibraryTest {
    Library lib;

    @Before
    public void setup() {
        lib = new Library();
    }

    @Test
    public void getBookListReturnsAListTest() {
        assertThat(lib.getBookList(), instanceOf(List.class));
    }

    @Test
    public void addBookAddsTheBookToBookListTest() {
        lib.addBook(new Book());
        assertThat(lib.getBookList().size(), is(1));
    }

    //test library contains book that was added
    @Test
    public void addBookAddsSameBookToBookListTest() {
        Book book = new Book("Call of The Wild");
        lib.addBook(book);
        assertThat(lib.getBookList(), hasItem(book));
    }

    //test add book does not change other books in library
    @Test
    public void addBookDoesNotChangeOtherBooksInListTest() {
        Book firstBook = new Book("Hamlet");
        Book secondBook = new Book("Lion King");
        lib.addBook(firstBook);
        lib.addBook(secondBook);
        assertThat(lib.getBookList(), hasItems(firstBook, secondBook));
    }

    @Test
    public void checkoutBookRemovesBookFromList() {
        String title = "Three Blind Mice";
        Book book = new Book(title);
        lib.addBook(book));
        lib.checkoutBook(title);
        assertThat(lib.getBookList(), not(hasItem(book)));
    }
}
<commit_msg>implemented method to checkout book, added another test for it on successful checkout<commit_after>package com.twu.biblioteca;

import org.junit.Before;
import org.junit.Test;

import java.util.List;

import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsCollectionContaining.hasItem;
import static org.hamcrest.core.IsCollectionContaining.hasItems;
import static org.hamcrest.core.IsNot.not;

/**
 * Created by nataliadjohari on 21/02/2017.
 */
public class LibraryTest {
    Library lib;

    @Before
    public void setup() {
        lib = new Library();
    }

    @Test
    public void getBookListReturnsAListTest() {
        assertThat(lib.getBookList(), instanceOf(List.class));
    }

    @Test
    public void addBookAddsTheBookToBookListTest() {
        lib.addBook(new Book());
        assertThat(lib.getBookList().size(), is(1));
    }

    //test library contains book that was added
    @Test
    public void addBookAddsSameBookToBookListTest() {
        Book book = new Book("Call of The Wild");
        lib.addBook(book);
        assertThat(lib.getBookList(), hasItem(book));
    }

    //test add book does not change other books in library
    @Test
    public void addBookDoesNotChangeOtherBooksInListTest() {
        Book firstBook = new Book("Hamlet");
        Book secondBook = new Book("Lion King");
        lib.addBook(firstBook);
        lib.addBook(secondBook);
        assertThat(lib.getBookList(), hasItems(firstBook, secondBook));
    }

    @Test
    public void checkoutBookRemovesBookFromList() {
        String title = "Three Blind Mice";
        Book book = new Book(title);
        lib.addBook(book);
        lib.checkoutBook(title);
        assertThat(lib.getBookList(), not(hasItem(book)));
    }

    @Test
    public void checkoutBookSuccessfullyReturnsTrue() {
        String title = "Three Blind Mice";
        Book book = new Book(title);
        lib.addBook(book);
        assertThat(lib.checkoutBook(title), is(true));
    }
}

{'fraction_non_alphanumeric': 0.10776421708647105, 'fraction_numerical': 0.004674110620618021, 'mean_word_length': 3.137486573576799, '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': '3857095', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1141, 'n_words': 271}