package com.twu.biblioteca.helper;

import com.twu.biblioteca.entity.Book;
import com.twu.biblioteca.entity.User;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class LibraryHelperTest {
    private Libraryhelper libraryHelper;

    @Before
    public void initLibraryHelper() {
        libraryHelper = new Libraryhelper();
    }

    @Test
    public void initLibraryTest() {
        User user = new User("zhzhang", "1111", "customer");
        assertEquals(user.getName(), libraryHelper.initLibrary().getUsers().get(0).getName());
        assertEquals(user.getPassword(), libraryHelper.initLibrary().getUsers().get(0).getPassword());

        Book book = new Book("Refactoring: Improving the Design of Existing Code", "Martin Fowler", "July 8, 1999");
        assertEquals(book.getName(), libraryHelper.initLibrary().getBooks().get(0).getName());
        assertEquals(book.getAuthor(), libraryHelper.initLibrary().getBooks().get(0).getAuthor());

    }
}

@@ -200,16 +200,59 @@
 tEquals;
+%0Aimport static org.junit.Assert.assertThat;
 %0A%0Apublic
@@ -278,16 +278,17 @@
 rTest %7B%0A
+%0A
     priv
@@ -367,24 +367,25 @@
 yHelper() %7B%0A
+%0A
         libr
@@ -434,16 +434,16 @@
   @Test%0A
-
     publ
@@ -470,16 +470,17 @@
 est() %7B%0A
+%0A
         
@@ -1048,11 +1048,220 @@
 ;%0A%0A    %7D
+%0A%0A    @Test%0A    public void canShowWelcomeMessageTest() %7B%0A%0A        String welcomeMessage = %22----- WELCOME TO BIBLIOTECA -----%5Cn%22;%0A        assertEquals(welcomeMessage, libraryHelper.showWelcomeMessage());%0A    %7D
 %0A%7D%0A

add canShowWelcomeMessageTest code