Add test for adding a field.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 23 Oct 2013 05:01:46 +0000 (07:01 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 28 Feb 2014 21:25:33 +0000 (22:25 +0100)
src/test/java/net/pterodactylus/sone/data/ProfileTest.java

index 4f81966..eab4062 100644 (file)
@@ -19,6 +19,7 @@ package net.pterodactylus.sone.data;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
 
 import net.pterodactylus.sone.data.Profile.Field;
 
@@ -34,6 +35,14 @@ public class ProfileTest {
        final Profile profile = new Profile((Sone) null);
 
        @Test
+       public void testAddingAField() {
+               profile.addField("TestField");
+               Field testField = profile.getFieldByName("TestField");
+               assertThat(testField, notNullValue());
+               assertThat(testField.getName(), is("TestField"));
+       }
+
+       @Test
        public void testRenamingAField() {
                profile.addField("TestField");
                Field testField = profile.getFieldByName("TestField");