From 7700267c466483342cb211224af93fb033d05480 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 24 Oct 2013 07:01:38 +0200 Subject: [PATCH] Test setting a/no avatar. --- src/test/java/net/pterodactylus/sone/data/ProfileTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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)); + } + } -- 2.7.4