// // SDLImageFieldSpec.m // SmartDeviceLink #import #import #import #import "SDLFileType.h" #import "SDLImageField.h" #import "SDLImageFieldName.h" #import "SDLImageResolution.h" #import "SDLNames.h" QuickSpecBegin(SDLImageFieldSpec) SDLImageResolution* resolution = [[SDLImageResolution alloc] init]; describe(@"Getter/Setter Tests", ^ { it(@"Should set and get correctly", ^ { SDLImageField* testStruct = [[SDLImageField alloc] init]; testStruct.name = SDLImageFieldNameTurnIcon; testStruct.imageTypeSupported = [@[SDLFileTypePNG, SDLFileTypeJPEG] copy]; testStruct.imageResolution = resolution; expect(testStruct.name).to(equal(SDLImageFieldNameTurnIcon)); expect(testStruct.imageTypeSupported).to(equal([@[SDLFileTypePNG, SDLFileTypeJPEG] copy])); expect(testStruct.imageResolution).to(equal(resolution)); }); it(@"Should get correctly when initialized", ^ { NSMutableDictionary* dict = [@{SDLNameName:SDLImageFieldNameTurnIcon, SDLNameImageTypeSupported:[@[SDLFileTypePNG, SDLFileTypeJPEG] copy], SDLNameImageResolution:resolution} mutableCopy]; SDLImageField* testStruct = [[SDLImageField alloc] initWithDictionary:dict]; expect(testStruct.name).to(equal(SDLImageFieldNameTurnIcon)); expect(testStruct.imageTypeSupported).to(equal([@[SDLFileTypePNG, SDLFileTypeJPEG] copy])); expect(testStruct.imageResolution).to(equal(resolution)); }); it(@"Should return nil if not set", ^ { SDLImageField* testStruct = [[SDLImageField alloc] init]; expect(testStruct.name).to(beNil()); expect(testStruct.imageTypeSupported).to(beNil()); expect(testStruct.imageResolution).to(beNil()); }); }); QuickSpecEnd