Permalink
Browse files

Added debug log

  • Loading branch information...
1 parent de1cb63 commit aa6f353ab84c67db3a3ff23dfee26563d46a6ecf @odrobnik odrobnik committed Nov 14, 2013
Showing with 18 additions and 0 deletions.
  1. +18 −0 Test/Source/DTHTMLAttributedStringBuilderTest.m
@@ -199,6 +199,16 @@ - (void)testAttachmentAutoSize
STAssertEquals(attachment.originalSize, expectedOriginalSize, @"Non-expected originalSize");
STAssertEquals(attachment.displaySize, expectedDisplaySize, @"Non-expected displaySize");
+
+ STAssertTrue([attachment isKindOfClass:[DTImageTextAttachment class]], @"Wrong Attachment Class");
+
+ if ([attachment isKindOfClass:[DTImageTextAttachment class]])
+ {
+ DTImageTextAttachment *imageAttachment = (DTImageTextAttachment *)attachment;
+
+ STAssertNotNil([imageAttachment image], @"There should be an image!");
+ NSLog(@"%@", [imageAttachment image]);
+ }
}
// parser should recover from no end element being sent for this img
@@ -212,6 +222,14 @@ - (void)testMissingClosingBracket
DTTextAttachment *attachment = [output attribute:NSAttachmentAttributeName atIndex:0 effectiveRange:NULL];
STAssertNotNil(attachment, @"No attachment found in output");
+
+ if ([attachment isKindOfClass:[DTImageTextAttachment class]])
+ {
+ DTImageTextAttachment *imageAttachment = (DTImageTextAttachment *)attachment;
+
+ STAssertNotNil([imageAttachment image], @"There should be an image!");
+ NSLog(@"%@", [imageAttachment image]);
+ }
}

0 comments on commit aa6f353

Please sign in to comment.