+ 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(expected = InvalidParentAlbum.class)
+ public void verifyThatAnInvalidParentAlbumCausesAnError() {
+ soneParser.parseSone(database, originalSone, getXml("invalid-parent-album"));
+ }
+
+ @Test(expected = MalformedXml.class)
+ public void verifyThatAnInvalidImageCausesAnError() {
+ soneParser.parseSone(database, originalSone, getXml("invalid-image"));
+ }
+
+ @Test(expected = MalformedDimension.class)
+ public void verifyThatInvalidImageDimensionsCauseAnError() {
+ soneParser.parseSone(database, originalSone, getXml("invalid-image-dimensions"));
+ }
+
+ @Test
+ public void verifyThatAnEmptyProfileIsParsedWithoutError() {
+ Sone sone = soneParser.parseSone(database, originalSone, getXml("empty-profile"));
+ assertThat(sone.getProfile().getFirstName(), nullValue());
+ assertThat(sone.getProfile().getMiddleName(), nullValue());
+ assertThat(sone.getProfile().getLastName(), nullValue());
+ assertThat(sone.getProfile().getBirthYear(), nullValue());
+ assertThat(sone.getProfile().getBirthMonth(), nullValue());
+ assertThat(sone.getProfile().getBirthDay(), nullValue());
+ assertThat(sone.getProfile().getAvatar(), nullValue());
+ assertThat(sone.getProfile().getFields(), empty());
+ }
+
+ @Test
+ public void verifyThatTheCreatedSoneMeetsAllExpectations() {
+ Sone sone = soneParser.parseSone(database, originalSone, getXml("complete"));