Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 46 lines (34 sloc) 1.787 kb
ba4545f @jlstrecker Initial commit
jlstrecker authored
1 #import "SkankySDK/SkankySDK-TestCase.h"
2 #import "DTConvertToDataPatch.h"
3 #import "DTConvertFromDataPatch.h"
4
5
6 @interface TestDTConvert : SkankySDK_TestCase
7 @end
8
9
10 @implementation TestDTConvert
11
12 - (void)testConvert
13 {
14 DTConvertToDataPatch *toPatch = [[DTConvertToDataPatch alloc] initWithIdentifier:nil];
15 DTConvertFromDataPatch *fromPatch = [[DTConvertFromDataPatch alloc] initWithIdentifier:nil];
16
17 NSNumber *numberInput = [NSNumber numberWithDouble:3.14];
18 [self setInputValue:numberInput forPort:@"inputObject" onPatch:toPatch];
19 [self executePatch:toPatch];
20 id numberData = [self getOutputForPort:@"outputRawData" onPatch:toPatch];
21 [self setInputValue:numberData forPort:@"inputRawData" onPatch:fromPatch];
22 [self executePatch:fromPatch];
23 GHAssertEqualObjects(numberInput, [self getOutputForPort:@"outputObject" onPatch:fromPatch], @"");
24
25 NSDictionary *structureInput = [NSDictionary dictionaryWithObjectsAndKeys: @"a", @"1", @"j", @"10", nil];
26 [self setInputValue:structureInput forPort:@"inputObject" onPatch:toPatch];
27 [self executePatch:toPatch];
28 id structureData = [self getOutputForPort:@"outputRawData" onPatch:toPatch];
29 [self setInputValue:structureData forPort:@"inputRawData" onPatch:fromPatch];
30 [self executePatch:fromPatch];
31 GHAssertEqualObjects(structureInput, [self getOutputForPort:@"outputObject" onPatch:fromPatch], @"");
32
33 [self setInputValue:nil forPort:@"inputObject" onPatch:toPatch];
34 [self executePatch:toPatch];
35 GHAssertNil([self getOutputForPort:@"outputRawData" onPatch:toPatch], @"");
36
37 [self setInputValue:nil forPort:@"inputRawData" onPatch:fromPatch];
38 [self executePatch:fromPatch];
39 GHAssertNil([self getOutputForPort:@"outputObject" onPatch:fromPatch], @"");
40
41 [toPatch release];
42 [fromPatch release];
43 }
44
45 @end
Something went wrong with that request. Please try again.