summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2018-05-18 10:57:29 -0400
committerGitHub <noreply@github.com>2018-05-18 10:57:29 -0400
commit75883f2815102568bd74d9e48c7e9f526d18e813 (patch)
treef3c54dd3eed321617922c54828589668476a4b8c
parent94d468ef87c2574fabc3e5f3717b0224e08935b6 (diff)
parent34ed36473ac4284c5e80af7e34a0509b62176a85 (diff)
downloadsdl_ios-75883f2815102568bd74d9e48c7e9f526d18e813.tar.gz
Merge pull request #967 from smartdevicelink/bugfix/issue_966_sdlshow_crash
Fix SDLShow initializer crash
-rw-r--r--SmartDeviceLink/SDLShow.h17
-rw-r--r--SmartDeviceLink/SDLShow.m18
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLShowSpec.m305
3 files changed, 285 insertions, 55 deletions
diff --git a/SmartDeviceLink/SDLShow.h b/SmartDeviceLink/SDLShow.h
index 8eef691a6..a20461801 100644
--- a/SmartDeviceLink/SDLShow.h
+++ b/SmartDeviceLink/SDLShow.h
@@ -226,8 +226,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
* @abstract The Custom Presets defined by the App
*
- * @discussion A Vector value representing the Custom Presets defined by the
- * App
+ * @discussion A Vector value representing the Custom Presets defined by the App
* <p>
* <ul>
* <li>If omitted on supported displays, the presets will be shown as not defined</li>
@@ -239,15 +238,11 @@ NS_ASSUME_NONNULL_BEGIN
@property (strong, nonatomic, nullable) NSArray<NSString *> *customPresets;
/**
- * @abstract Text Field Metadata
- *
- * @discussion A Vector value representing the Custom Presets defined by the
- * App
- * <p>
- * App defined metadata information. See MetadataStruct. Uses mainField1, mainField2, mainField3, mainField4.
- * If omitted on supported displays, the currently set metadata tags will not change.
- * If any text field contains no tags or the none tag, the metadata tag for that textfield should be removed.
- * @since SmartDeviceLink 2.0
+ Text Field Metadata
+
+ App defined metadata information. See MetadataStruct. Uses mainField1, mainField2, mainField3, mainField4. If omitted on supported displays, the currently set metadata tags will not change. If any text field contains no tags or the none tag, the metadata tag for that textfield should be removed.
+
+ @since SmartDeviceLink 2.0
*/
@property (strong, nonatomic, nullable) SDLMetadataTags *metadataTags;
diff --git a/SmartDeviceLink/SDLShow.m b/SmartDeviceLink/SDLShow.m
index 388865d24..743e4940a 100644
--- a/SmartDeviceLink/SDLShow.m
+++ b/SmartDeviceLink/SDLShow.m
@@ -31,9 +31,9 @@ NS_ASSUME_NONNULL_BEGIN
return nil;
}
- NSArray<SDLMetadataType> *field1Array = @[mainField1Type];
- NSArray<SDLMetadataType> *field2Array = @[mainField2Type];
- SDLMetadataTags* metadataTags = [[SDLMetadataTags alloc] initWithTextFieldTypes:field1Array mainField2:field2Array];
+ NSArray<SDLMetadataType> *field1Array = mainField1Type ? @[mainField1Type] : nil;
+ NSArray<SDLMetadataType> *field2Array = mainField2Type ? @[mainField2Type] : nil;
+ SDLMetadataTags* metadataTags = (field1Array != nil || field2Array != nil) ? [[SDLMetadataTags alloc] initWithTextFieldTypes:field1Array mainField2:field2Array] : nil;
self.mainField1 = mainField1;
self.mainField2 = mainField2;
@@ -47,17 +47,17 @@ NS_ASSUME_NONNULL_BEGIN
return [self initWithMainField1:mainField1 mainField2:mainField2 mainField3:mainField3 mainField4:mainField4 alignment:alignment statusBar:nil mediaClock:nil mediaTrack:nil graphic:nil softButtons:nil customPresets:nil textFieldMetadata:nil];
}
-- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField1Type:(nullable SDLMetadataType)mainField1Type mainField2:(nullable NSString *)mainField2 mainField2Type:(nullable SDLMetadataType)mainField2Type mainField3:(nullable NSString *)mainField3 mainField3Type:(nullable SDLMetadataType)mainField3Type mainField4:(nullable NSString *)mainField4 mainField4Type:(nullable SDLMetadataType)mainField4Type alignment:(nullable SDLTextAlignment)alignment{
+- (instancetype)initWithMainField1:(nullable NSString *)mainField1 mainField1Type:(nullable SDLMetadataType)mainField1Type mainField2:(nullable NSString *)mainField2 mainField2Type:(nullable SDLMetadataType)mainField2Type mainField3:(nullable NSString *)mainField3 mainField3Type:(nullable SDLMetadataType)mainField3Type mainField4:(nullable NSString *)mainField4 mainField4Type:(nullable SDLMetadataType)mainField4Type alignment:(nullable SDLTextAlignment)alignment {
self = [self init];
if (!self) {
return nil;
}
- NSArray<SDLMetadataType> *field1Array = @[mainField1Type];
- NSArray<SDLMetadataType> *field2Array = @[mainField2Type];
- NSArray<SDLMetadataType> *field3Array = @[mainField3Type];
- NSArray<SDLMetadataType> *field4Array = @[mainField4Type];
- SDLMetadataTags* metadataTags = [[SDLMetadataTags alloc] initWithTextFieldTypes:field1Array mainField2:field2Array mainField3:field3Array mainField4:field4Array];
+ NSArray<SDLMetadataType> *field1Array = mainField1Type ? @[mainField1Type] : nil;
+ NSArray<SDLMetadataType> *field2Array = mainField2Type ? @[mainField2Type] : nil;
+ NSArray<SDLMetadataType> *field3Array = mainField3Type ? @[mainField3Type] : nil;
+ NSArray<SDLMetadataType> *field4Array = mainField4Type ? @[mainField4Type] : nil;
+ SDLMetadataTags* metadataTags = (field1Array != nil || field2Array != nil || field3Array != nil || field4Array != nil) ? [[SDLMetadataTags alloc] initWithTextFieldTypes:field1Array mainField2:field2Array mainField3:field3Array mainField4:field4Array] : nil;
self.mainField1 = mainField1;
self.mainField2 = mainField2;
diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLShowSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLShowSpec.m
index 80733245e..e41d73cc8 100644
--- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLShowSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLShowSpec.m
@@ -59,41 +59,7 @@ describe(@"Getter/Setter Tests", ^ {
});
- it(@"Should get correctly when initialized", ^ {
- NSMutableDictionary* dict = [@{SDLNameRequest:
- @{SDLNameParameters:
- @{SDLNameMainField1:@"field1",
- SDLNameMainField2:@"field2",
- SDLNameMainField3:@"field3",
- SDLNameMainField4:@"field4",
- SDLNameAlignment:SDLTextAlignmentLeft,
- SDLNameStatusBar:@"status",
- SDLNameMediaClock:@"TheTime",
- SDLNameMediaTrack:@"In The Clear",
- SDLNameGraphic:image1,
- SDLNameSecondaryGraphic:image2,
- SDLNameSoftButtons:[@[button] mutableCopy],
- SDLNameCustomPresets:[@[@"preset1", @"preset2"] mutableCopy],
- SDLNameMetadataTags:testMetadata},
- SDLNameOperationName:SDLNameShow}} mutableCopy];
- SDLShow* testRequest = [[SDLShow alloc] initWithDictionary:dict];
-
- expect(testRequest.mainField1).to(equal(@"field1"));
- expect(testRequest.mainField2).to(equal(@"field2"));
- expect(testRequest.mainField3).to(equal(@"field3"));
- expect(testRequest.mainField4).to(equal(@"field4"));
- expect(testRequest.alignment).to(equal(SDLTextAlignmentLeft));
- expect(testRequest.statusBar).to(equal(@"status"));
- expect(testRequest.mediaClock).to(equal(@"TheTime"));
- expect(testRequest.mediaTrack).to(equal(@"In The Clear"));
- expect(testRequest.graphic).to(equal(image1));
- expect(testRequest.secondaryGraphic).to(equal(image2));
- expect(testRequest.softButtons).to(equal([@[button] mutableCopy]));
- expect(testRequest.customPresets).to(equal([@[@"preset1", @"preset2"] mutableCopy]));
- expect(testRequest.metadataTags).to(equal(testMetadata));
- });
-
- it(@"Should return nil if not set", ^ {
+ it(@"Should return nil if not set", ^{
SDLShow* testRequest = [[SDLShow alloc] init];
expect(testRequest.mainField1).to(beNil());
@@ -110,6 +76,275 @@ describe(@"Getter/Setter Tests", ^ {
expect(testRequest.customPresets).to(beNil());
expect(testRequest.metadataTags).to(beNil());
});
+
+ describe(@"initializing", ^{
+ __block NSString *testString1 = @"Test 1";
+ __block NSString *testString2 = @"Test 2";
+ __block NSString *testString3 = @"Test 3";
+ __block NSString *testString4 = @"Test 4";
+ __block NSString *testStatusBarString = @"Test Status";
+ __block NSString *testMediaClockString = @"Test Clock";
+ __block NSString *testMediaTrackString = @"Test Track";
+ __block SDLImage *testGraphic = nil;
+ __block NSArray<NSString *> *testCustomPresets = nil;
+ __block SDLSoftButton *testButton = nil;
+ __block NSArray<SDLSoftButton *> *testSoftButtons = nil;
+ __block SDLMetadataType testType1 = SDLMetadataTypeHumidity;
+ __block SDLMetadataType testType2 = SDLMetadataTypeRating;
+ __block SDLMetadataType testType3 = SDLMetadataTypeMediaYear;
+ __block SDLMetadataType testType4 = SDLMetadataTypeWeatherTerm;
+ __block SDLTextAlignment testAlignment = SDLTextAlignmentCenter;
+ __block SDLMetadataTags *testTags = nil;
+
+ beforeEach(^{
+ testGraphic = [[SDLImage alloc] initWithName:@"test name"];
+ testCustomPresets = @[testString1];
+ testButton = [[SDLSoftButton alloc] initWithType:SDLSoftButtonTypeText text:@"Test Button" image:nil highlighted:NO buttonId:0 systemAction:nil handler:nil];
+ testSoftButtons = @[testButton];
+ testTags = [[SDLMetadataTags alloc] initWithTextFieldTypes:@[testType1] mainField2:@[testType2] mainField3:@[testType3] mainField4:@[testType4]];
+ });
+
+ it(@"should initialize with initWithMainField1:mainField2:alignment:", ^{
+ SDLShow *testShow = [[SDLShow alloc] initWithMainField1:testString1 mainField2:testString2 alignment:testAlignment];
+ expect(testShow.mainField1).to(equal(testString1));
+ expect(testShow.mainField2).to(equal(testString2));
+ expect(testShow.mainField3).to(beNil());
+ expect(testShow.mainField4).to(beNil());
+ expect(testShow.alignment).to(equal(testAlignment));
+ expect(testShow.statusBar).to(beNil());
+ expect(testShow.mediaClock).to(beNil());
+ expect(testShow.mediaTrack).to(beNil());
+ expect(testShow.graphic).to(beNil());
+ expect(testShow.secondaryGraphic).to(beNil());
+ expect(testShow.softButtons).to(beNil());
+ expect(testShow.customPresets).to(beNil());
+ expect(testShow.metadataTags).to(beNil());
+
+ testShow = [[SDLShow alloc] initWithMainField1:nil mainField2:nil alignment:nil];
+ expect(testShow.mainField1).to(beNil());
+ expect(testShow.mainField2).to(beNil());
+ expect(testShow.mainField3).to(beNil());
+ expect(testShow.mainField4).to(beNil());
+ expect(testShow.alignment).to(beNil());
+ expect(testShow.statusBar).to(beNil());
+ expect(testShow.mediaClock).to(beNil());
+ expect(testShow.mediaTrack).to(beNil());
+ expect(testShow.graphic).to(beNil());
+ expect(testShow.secondaryGraphic).to(beNil());
+ expect(testShow.softButtons).to(beNil());
+ expect(testShow.customPresets).to(beNil());
+ expect(testShow.metadataTags).to(beNil());
+ });
+
+ it(@"should initialize correctly with initWithMainField1:mainField1Type:mainField2:mainField2Type:alignment:", ^{
+ SDLShow *testShow = [[SDLShow alloc] initWithMainField1:testString1 mainField1Type:testType1 mainField2:testString2 mainField2Type:testType2 alignment:testAlignment];
+ expect(testShow.mainField1).to(equal(testString1));
+ expect(testShow.mainField2).to(equal(testString2));
+ expect(testShow.mainField3).to(beNil());
+ expect(testShow.mainField4).to(beNil());
+ expect(testShow.alignment).to(equal(testAlignment));
+ expect(testShow.statusBar).to(beNil());
+ expect(testShow.mediaClock).to(beNil());
+ expect(testShow.mediaTrack).to(beNil());
+ expect(testShow.graphic).to(beNil());
+ expect(testShow.secondaryGraphic).to(beNil());
+ expect(testShow.softButtons).to(beNil());
+ expect(testShow.customPresets).to(beNil());
+ expect(testShow.metadataTags.mainField1).to(contain(testType1));
+ expect(testShow.metadataTags.mainField2).to(contain(testType2));
+ expect(testShow.metadataTags.mainField3).to(beNil());
+ expect(testShow.metadataTags.mainField4).to(beNil());
+
+ testShow = [[SDLShow alloc] initWithMainField1:nil mainField1Type:nil mainField2:nil mainField2Type:nil alignment:nil];
+ expect(testShow.mainField1).to(beNil());
+ expect(testShow.mainField2).to(beNil());
+ expect(testShow.mainField3).to(beNil());
+ expect(testShow.mainField4).to(beNil());
+ expect(testShow.alignment).to(beNil());
+ expect(testShow.statusBar).to(beNil());
+ expect(testShow.mediaClock).to(beNil());
+ expect(testShow.mediaTrack).to(beNil());
+ expect(testShow.graphic).to(beNil());
+ expect(testShow.secondaryGraphic).to(beNil());
+ expect(testShow.softButtons).to(beNil());
+ expect(testShow.customPresets).to(beNil());
+ expect(testShow.metadataTags).to(beNil());
+ });
+
+ it(@"should initialize correctly with initWithMainField1:mainField2:mainField3:mainField4:alignment:", ^{
+ SDLShow *testShow = [[SDLShow alloc] initWithMainField1:testString1 mainField2:testString2 mainField3:testString3 mainField4:testString4 alignment:testAlignment];
+ expect(testShow.mainField1).to(equal(testString1));
+ expect(testShow.mainField2).to(equal(testString2));
+ expect(testShow.mainField3).to(equal(testString3));
+ expect(testShow.mainField4).to(equal(testString4));
+ expect(testShow.alignment).to(equal(testAlignment));
+ expect(testShow.statusBar).to(beNil());
+ expect(testShow.mediaClock).to(beNil());
+ expect(testShow.mediaTrack).to(beNil());
+ expect(testShow.graphic).to(beNil());
+ expect(testShow.secondaryGraphic).to(beNil());
+ expect(testShow.softButtons).to(beNil());
+ expect(testShow.customPresets).to(beNil());
+ expect(testShow.metadataTags.mainField1).to(beNil());
+ expect(testShow.metadataTags.mainField2).to(beNil());
+ expect(testShow.metadataTags.mainField3).to(beNil());
+ expect(testShow.metadataTags.mainField4).to(beNil());
+
+ testShow = [[SDLShow alloc] initWithMainField1:nil mainField2:nil mainField3:nil mainField4:nil alignment:nil];
+ expect(testShow.mainField1).to(beNil());
+ expect(testShow.mainField2).to(beNil());
+ expect(testShow.mainField3).to(beNil());
+ expect(testShow.mainField4).to(beNil());
+ expect(testShow.alignment).to(beNil());
+ expect(testShow.statusBar).to(beNil());
+ expect(testShow.mediaClock).to(beNil());
+ expect(testShow.mediaTrack).to(beNil());
+ expect(testShow.graphic).to(beNil());
+ expect(testShow.secondaryGraphic).to(beNil());
+ expect(testShow.softButtons).to(beNil());
+ expect(testShow.customPresets).to(beNil());
+ expect(testShow.metadataTags).to(beNil());
+ });
+
+ it(@"should initialize correctly with initWithMainField1:mainField1Type:mainField2:mainField2Type:mainField3:mainField3Type:mainField4:mainField4Type:alignment:", ^{
+ SDLShow *testShow = [[SDLShow alloc] initWithMainField1:testString1 mainField1Type:testType1 mainField2:testString2 mainField2Type:testType2 mainField3:testString3 mainField3Type:testType3 mainField4:testString4 mainField4Type:testType4 alignment:testAlignment];
+ expect(testShow.mainField1).to(equal(testString1));
+ expect(testShow.mainField2).to(equal(testString2));
+ expect(testShow.mainField3).to(equal(testString3));
+ expect(testShow.mainField4).to(equal(testString4));
+ expect(testShow.alignment).to(equal(testAlignment));
+ expect(testShow.statusBar).to(beNil());
+ expect(testShow.mediaClock).to(beNil());
+ expect(testShow.mediaTrack).to(beNil());
+ expect(testShow.graphic).to(beNil());
+ expect(testShow.secondaryGraphic).to(beNil());
+ expect(testShow.softButtons).to(beNil());
+ expect(testShow.customPresets).to(beNil());
+ expect(testShow.metadataTags.mainField1).to(contain(testType1));
+ expect(testShow.metadataTags.mainField2).to(contain(testType2));
+ expect(testShow.metadataTags.mainField3).to(contain(testType3));
+ expect(testShow.metadataTags.mainField4).to(contain(testType4));
+
+ testShow = [[SDLShow alloc] initWithMainField1:nil mainField1Type:nil mainField2:nil mainField2Type:nil mainField3:nil mainField3Type:nil mainField4:nil mainField4Type:nil alignment:nil];
+ expect(testShow.mainField1).to(beNil());
+ expect(testShow.mainField2).to(beNil());
+ expect(testShow.mainField3).to(beNil());
+ expect(testShow.mainField4).to(beNil());
+ expect(testShow.alignment).to(beNil());
+ expect(testShow.statusBar).to(beNil());
+ expect(testShow.mediaClock).to(beNil());
+ expect(testShow.mediaTrack).to(beNil());
+ expect(testShow.graphic).to(beNil());
+ expect(testShow.secondaryGraphic).to(beNil());
+ expect(testShow.softButtons).to(beNil());
+ expect(testShow.customPresets).to(beNil());
+ expect(testShow.metadataTags).to(beNil());
+ });
+
+ it(@"should initialize correctly with initWithMainField1:mainField2:alignment:statusBar:mediaClock:mediaTrack:", ^{
+ SDLShow *testShow = [[SDLShow alloc] initWithMainField1:testString1 mainField2:testString2 alignment:testAlignment statusBar:testStatusBarString mediaClock:testMediaClockString mediaTrack:testMediaTrackString];
+ expect(testShow.mainField1).to(equal(testString1));
+ expect(testShow.mainField2).to(equal(testString2));
+ expect(testShow.mainField3).to(beNil());
+ expect(testShow.mainField4).to(beNil());
+ expect(testShow.alignment).to(equal(testAlignment));
+ expect(testShow.statusBar).to(equal(testStatusBarString));
+ expect(testShow.mediaClock).to(equal(testMediaClockString));
+ expect(testShow.mediaTrack).to(equal(testMediaTrackString));
+ expect(testShow.graphic).to(beNil());
+ expect(testShow.secondaryGraphic).to(beNil());
+ expect(testShow.softButtons).to(beNil());
+ expect(testShow.customPresets).to(beNil());
+ expect(testShow.metadataTags.mainField1).to(beNil());
+ expect(testShow.metadataTags.mainField2).to(beNil());
+ expect(testShow.metadataTags.mainField3).to(beNil());
+ expect(testShow.metadataTags.mainField4).to(beNil());
+
+ testShow = [[SDLShow alloc] initWithMainField1:nil mainField2:nil alignment:nil statusBar:nil mediaClock:nil mediaTrack:nil];
+ expect(testShow.mainField1).to(beNil());
+ expect(testShow.mainField2).to(beNil());
+ expect(testShow.mainField3).to(beNil());
+ expect(testShow.mainField4).to(beNil());
+ expect(testShow.alignment).to(beNil());
+ expect(testShow.statusBar).to(beNil());
+ expect(testShow.mediaClock).to(beNil());
+ expect(testShow.mediaTrack).to(beNil());
+ expect(testShow.graphic).to(beNil());
+ expect(testShow.secondaryGraphic).to(beNil());
+ expect(testShow.softButtons).to(beNil());
+ expect(testShow.customPresets).to(beNil());
+ expect(testShow.metadataTags).to(beNil());
+ });
+
+ it(@"should initialize correctly with initWithMainField1:mainField2:mainField3:mainField4:alignment:statusBar:mediaClock:mediaTrack:graphic:softButtons:customPresets:textFieldMetadata:", ^{
+ SDLShow *testShow = [[SDLShow alloc] initWithMainField1:testString1 mainField2:testString2 mainField3:testString3 mainField4:testString4 alignment:testAlignment statusBar:testStatusBarString mediaClock:testMediaClockString mediaTrack:testMediaTrackString graphic:testGraphic softButtons:testSoftButtons customPresets:testCustomPresets textFieldMetadata:testTags];
+ expect(testShow.mainField1).to(equal(testString1));
+ expect(testShow.mainField2).to(equal(testString2));
+ expect(testShow.mainField3).to(equal(testString3));
+ expect(testShow.mainField4).to(equal(testString4));
+ expect(testShow.alignment).to(equal(testAlignment));
+ expect(testShow.statusBar).to(equal(testStatusBarString));
+ expect(testShow.mediaClock).to(equal(testMediaClockString));
+ expect(testShow.mediaTrack).to(equal(testMediaTrackString));
+ expect(testShow.graphic).to(equal(testGraphic));
+ expect(testShow.secondaryGraphic).to(beNil());
+ expect(testShow.softButtons).to(contain(testButton));
+ expect(testShow.customPresets).to(contain(testString1));
+ expect(testShow.metadataTags.mainField1).to(contain(testType1));
+ expect(testShow.metadataTags.mainField2).to(contain(testType2));
+ expect(testShow.metadataTags.mainField3).to(contain(testType3));
+ expect(testShow.metadataTags.mainField4).to(contain(testType4));
+
+ testShow = [[SDLShow alloc] initWithMainField1:nil mainField2:nil mainField3:nil mainField4:nil alignment:nil statusBar:nil mediaClock:nil mediaTrack:nil graphic:nil softButtons:nil customPresets:nil textFieldMetadata:nil];
+ expect(testShow.mainField1).to(beNil());
+ expect(testShow.mainField2).to(beNil());
+ expect(testShow.mainField3).to(beNil());
+ expect(testShow.mainField4).to(beNil());
+ expect(testShow.alignment).to(beNil());
+ expect(testShow.statusBar).to(beNil());
+ expect(testShow.mediaClock).to(beNil());
+ expect(testShow.mediaTrack).to(beNil());
+ expect(testShow.graphic).to(beNil());
+ expect(testShow.secondaryGraphic).to(beNil());
+ expect(testShow.softButtons).to(beNil());
+ expect(testShow.customPresets).to(beNil());
+ expect(testShow.metadataTags).to(beNil());
+ });
+
+ it(@"Should get correctly when initialized with a dictionary", ^ {
+ NSMutableDictionary* dict = [@{SDLNameRequest:
+ @{SDLNameParameters:
+ @{SDLNameMainField1:@"field1",
+ SDLNameMainField2:@"field2",
+ SDLNameMainField3:@"field3",
+ SDLNameMainField4:@"field4",
+ SDLNameAlignment:SDLTextAlignmentLeft,
+ SDLNameStatusBar:@"status",
+ SDLNameMediaClock:@"TheTime",
+ SDLNameMediaTrack:@"In The Clear",
+ SDLNameGraphic:image1,
+ SDLNameSecondaryGraphic:image2,
+ SDLNameSoftButtons:[@[button] mutableCopy],
+ SDLNameCustomPresets:[@[@"preset1", @"preset2"] mutableCopy],
+ SDLNameMetadataTags:testMetadata},
+ SDLNameOperationName:SDLNameShow}} mutableCopy];
+ SDLShow* testRequest = [[SDLShow alloc] initWithDictionary:dict];
+
+ expect(testRequest.mainField1).to(equal(@"field1"));
+ expect(testRequest.mainField2).to(equal(@"field2"));
+ expect(testRequest.mainField3).to(equal(@"field3"));
+ expect(testRequest.mainField4).to(equal(@"field4"));
+ expect(testRequest.alignment).to(equal(SDLTextAlignmentLeft));
+ expect(testRequest.statusBar).to(equal(@"status"));
+ expect(testRequest.mediaClock).to(equal(@"TheTime"));
+ expect(testRequest.mediaTrack).to(equal(@"In The Clear"));
+ expect(testRequest.graphic).to(equal(image1));
+ expect(testRequest.secondaryGraphic).to(equal(image2));
+ expect(testRequest.softButtons).to(equal([@[button] mutableCopy]));
+ expect(testRequest.customPresets).to(equal([@[@"preset1", @"preset2"] mutableCopy]));
+ expect(testRequest.metadataTags).to(equal(testMetadata));
+ });
+ });
});
QuickSpecEnd