From: David ‘Bombe’ Roden Date: Wed, 23 Oct 2013 05:01:46 +0000 (+0200) Subject: Add test for adding a field. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=a4d663646b4510117b35529399cb380a50413b27;p=Sone.git Add test for adding a field. --- diff --git a/src/test/java/net/pterodactylus/sone/data/ProfileTest.java b/src/test/java/net/pterodactylus/sone/data/ProfileTest.java index 4f81966..eab4062 100644 --- a/src/test/java/net/pterodactylus/sone/data/ProfileTest.java +++ b/src/test/java/net/pterodactylus/sone/data/ProfileTest.java @@ -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");