package day13;

import static org.junit.Assert.assertEquals;

import org.junit.BeforeClass;
import org.junit.Test;

public class LibraryUserTest
{
	private static LibraryUser user;

	@BeforeClass
	public static void buildUp()
	{
		user = new LibraryUserImpl("Tirwit Cogwheel");
		user.setUserId(333);
	}

	@Test
	public void testUserName()
	{
		String expected = "Tirwit Cogwheel";
		String actual = user.getUserName();
		assertEquals(expected, actual);
	}

	@Test
	public void testUserId()
	{
		int expected = 333;
		int actual = user.getUserId();
		assertEquals(expected, actual);
	}

	@Test
	public void testRegister()
	{
		int expected = 5;
		int actual = user.register(null);
		assertEquals(expected, actual);
	}

	@Test
	public void testGetLibrary()
	{
		String expected = "Biblioteca de Alcacer do Sal";
		String actual = user.getLibrary();
		assertEquals(expected, actual);
	}

}
