Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

62 lines (52 sloc) 1.871 kB
//
// GBCommentTesting.m
// appledoc
//
// Created by Tomaz Kragelj on 25.7.10.
// Copyright (C) 2010 Gentle Bytes. All rights reserved.
//
#import "GBApplicationSettingsProvider.h"
#import "GBDataObjects.h"
@interface GBCommentTesting : GHTestCase
@end
@implementation GBCommentTesting
#pragma mark Initialization & disposal
- (void)testInit_shouldSetupDefaultComponents {
// setup & execute
GBComment *comment = [GBComment commentWithStringValue:@""];
// verify
assertThat(comment.longDescription, isNot(nil));
assertThat(comment.relatedItems, isNot(nil));
assertThat(comment.methodParameters, isNot(nil));
assertThat(comment.methodExceptions, isNot(nil));
assertThat(comment.methodResult, isNot(nil));
assertThat(comment.availability, isNot(nil));
}
#pragma mark Comment components testing
- (void)testHtmlString_shouldUseAssignedSettings {
// setup
GBCommentComponent *component = [GBCommentComponent componentWithStringValue:@"source"];
component.markdownValue = @"markdown";
OCMockObject *settings = [GBTestObjectsRegistry mockSettingsProvider];
component.settings = settings;
[[settings expect] stringByConvertingMarkdownToHTML:component.markdownValue];
// execute
NSString *html = component.htmlValue;
// verify
[settings verify];
html = nil; // just to suppress compiler warning of unused var...
}
- (void)testTextString_shouldUseAssignedSettings {
// setup
GBCommentComponent *component = [GBCommentComponent componentWithStringValue:@"source"];
component.markdownValue = @"markdown";
OCMockObject *settings = [GBTestObjectsRegistry mockSettingsProvider];
component.settings = settings;
[[settings expect] stringByConvertingMarkdownToText:component.markdownValue];
// execute
NSString *html = component.textValue;
// verify
[settings verify];
html = nil; // just to suppress compiler warning of unused var...
}
@end
Jump to Line
Something went wrong with that request. Please try again.