summaryrefslogtreecommitdiff
path: root/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSetInteriorVehicleDataResponseSpec.m
blob: a41210e91f77a30f22e9945579e145e563da7109 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
//  SDLSetInteriorVehicleDataResponseSpec.m
//  SmartDeviceLink-iOS
//

#import <Foundation/Foundation.h>

#import <Quick/Quick.h>
#import <Nimble/Nimble.h>

#import "SDLSetInteriorVehicleDataResponse.h"
#import "SDLModuleData.h"
#import "SDLNames.h"

QuickSpecBegin(SDLSetInteriorVehicleDataResponseSpec)

describe(@"Getter/Setter Tests", ^ {
    __block SDLModuleData* someModuleData = nil;
    
    beforeEach(^{
        someModuleData = [[SDLModuleData alloc] init];
    });
    
    it(@"Should set and get correctly", ^ {
        SDLSetInteriorVehicleDataResponse* testResponse = [[SDLSetInteriorVehicleDataResponse alloc] init];
        testResponse.moduleData = someModuleData;
        
        expect(testResponse.moduleData).to(equal(someModuleData));
    });
    
    
    
    it(@"Should get correctly when initialized", ^ {
        NSMutableDictionary<NSString *, id> *dict = [@{SDLNameResponse:
                                                           @{SDLNameParameters:
                                                                 @{SDLNameModuleData:someModuleData},
                                                             SDLNameOperationName:SDLNameSetInteriorVehicleData}} mutableCopy];
        SDLSetInteriorVehicleDataResponse* testResponse = [[SDLSetInteriorVehicleDataResponse alloc] initWithDictionary:dict];
        
        expect(testResponse.moduleData).to(equal(someModuleData));
    });
    
    it(@"Should return nil if not set", ^ {
        SDLSetInteriorVehicleDataResponse* testResponse = [[SDLSetInteriorVehicleDataResponse alloc] init];
        
        expect(testResponse.moduleData).to(beNil());
    });
});

QuickSpecEnd