From a97d66d85ec4a97e2d46811790569b83a16b28f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 26 Oct 2013 00:17:26 +0200 Subject: [PATCH] Add test for encoding likes. --- .../net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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())); + } + } -- 2.7.4