Test setting a/no avatar.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 24 Oct 2013 05:01:38 +0000 (07:01 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 28 Feb 2014 21:25:34 +0000 (22:25 +0100)
src/test/java/net/pterodactylus/sone/data/ProfileTest.java

index ab68bc9..a4e70c0 100644 (file)
@@ -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.<String>absent());
+               assertThat(profile.getAvatar(), is((String) null));
+       }
+
 }