Verify that an invalid album causes an error.
[Sone.git] / src / test / java / net / pterodactylus / sone / core / SoneParserTest.java
index 4bfed61..87f6600 100644 (file)
@@ -141,6 +141,26 @@ public class SoneParserTest {
        }
 
        @Test
+       public void verifyThatAMissingPostLikesSectionDoesNotCauseAnError() {
+               soneParser.parseSone(database, originalSone, getXml("missing-post-likes"));
+       }
+
+       @Test
+       public void verifyThatAMissingReplyLikesSectionDoesNotCauseAnError() {
+               soneParser.parseSone(database, originalSone, getXml("missing-reply-likes"));
+       }
+
+       @Test
+       public void verifyThatMissingAlbumsSectionDoNotCauseAnError() {
+               soneParser.parseSone(database, originalSone, getXml("missing-albums"));
+       }
+
+       @Test(expected = MalformedXml.class)
+       public void verifyThatAnInvalidAlbumCausesAnError() {
+               soneParser.parseSone(database, originalSone, getXml("invalid-album"));
+       }
+
+       @Test
        public void verifyThatAnEmptyProfileIsParsedWithoutError() {
                Sone sone = soneParser.parseSone(database, originalSone, getXml("empty-profile"));
                assertThat(sone.getProfile().getFirstName(), nullValue());