From: David ‘Bombe’ Roden Date: Fri, 25 Oct 2013 22:17:26 +0000 (+0200) Subject: Add test for encoding likes. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=a97d66d85ec4a97e2d46811790569b83a16b28f1;p=Sone.git Add test for encoding likes. --- diff --git a/src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java b/src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java index c7c46a0..8867a36 100644 --- a/src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java +++ b/src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java @@ -204,4 +204,15 @@ public class AbstractSoneCommandTest { return postReply; } + @Test + public void testEncodingLikes() throws FSParseException { + List likes = prepareMultipleSones(); + SimpleFieldSet likesFieldSet = AbstractSoneCommand.encodeLikes(likes, "Prefix."); + assertThat(likesFieldSet, notNullValue()); + assertThat(likesFieldSet.getInt("Prefix.Count"), is(likes.size())); + assertThat(likesFieldSet.get("Prefix.0.ID"), is(likes.get(0).getId())); + assertThat(likesFieldSet.get("Prefix.1.ID"), is(likes.get(1).getId())); + assertThat(likesFieldSet.get("Prefix.2.ID"), is(likes.get(2).getId())); + } + }