package jp.cafebabe.kunai.entries;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.is;

import org.hamcrest.Matchers;
import org.junit.Before;
import org.junit.Test;

public class NameTest {
    private Name name;

    @Before
    public void setUp(){
        name = new Name("Haruaki Tamada");
    }

    @Test
    public void testBasic(){
        assertThat(name, is(new Name("Haruaki Tamada")));
        assertThat(name, is(not(new Name("Nanashi no Gonbe"))));
        assertThat(name, is(not("Haruaki Tamada")));
        assertThat(name, is(not(new Object())));

        assertThat(name.toString(), is("Haruaki Tamada"));
        assertThat(name.name(), is("Haruaki Tamada"));
    }
}

@@ -762,11 +762,625 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testMatch() %7B%0A        assertThat(name.matches(%22H.*Tamada%22), is(true));%0A        assertThat(name.matches(%22tamada%22), is(false));%0A        assertThat(name.contains(%22ki Ta%22), is(true));%0A        assertThat(name.endsWith(%22a%22), is(true));%0A        assertThat(name.startsWith(%22H%22), is(true));%0A    %7D%0A%0A    @Test%0A    public void testEquals() %7B%0A        assertThat(name.equals(new Name(%22Haruaki Tamada%22)), is(true));%0A        assertThat(name.equals(new Name(%22Different Name%22)), is(false));%0A        assertThat(name.equals(new Object()), is(false));%0A        assertThat(name.equals(null), is(false));%0A    %7D
 %0A%7D%0A

update unit test