From: David ‘Bombe’ Roden Date: Thu, 24 Oct 2013 05:01:38 +0000 (+0200) Subject: Test setting a/no avatar. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7700267c466483342cb211224af93fb033d05480;p=Sone.git Test setting a/no avatar. --- diff --git a/src/test/java/net/pterodactylus/sone/data/ProfileTest.java b/src/test/java/net/pterodactylus/sone/data/ProfileTest.java index ab68bc9..a4e70c0 100644 --- a/src/test/java/net/pterodactylus/sone/data/ProfileTest.java +++ b/src/test/java/net/pterodactylus/sone/data/ProfileTest.java @@ -17,6 +17,7 @@ package net.pterodactylus.sone.data; +import static com.google.common.base.Optional.of; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.is; @@ -180,4 +181,16 @@ public class ProfileTest { assertThat(profile.getBirthDay(), is(24)); } + @Test + public void testSettingAnAvatar() { + profile.setAvatar(of("avatar1")); + assertThat(profile.getAvatar(), is("avatar1")); + } + + @Test + public void testSettingNoAvatar() { + profile.setAvatar(Optional.absent()); + assertThat(profile.getAvatar(), is((String) null)); + } + }