From a4d663646b4510117b35529399cb380a50413b27 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 23 Oct 2013 07:01:46 +0200 Subject: [PATCH] Add test for adding a field. --- src/test/java/net/pterodactylus/sone/data/ProfileTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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"); -- 2.7.4