summaryrefslogtreecommitdiff
path: root/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHeadLampStatusSpec.m
blob: fe7a21198eb157afc4d2f7ffb41e291517a37038 (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
51
//
//  SDLHeadLampStatusSpec.m
//  SmartDeviceLink


#import <Foundation/Foundation.h>

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

#import "SDLAmbientLightStatus.h"
#import "SDLHeadLampStatus.h"
#import "SDLNames.h"


QuickSpecBegin(SDLHeadLampStatusSpec)

describe(@"Getter/Setter Tests", ^ {
    it(@"Should set and get correctly", ^ {
        SDLHeadLampStatus* testStruct = [[SDLHeadLampStatus alloc] init];
        
        testStruct.lowBeamsOn = @YES;
        testStruct.highBeamsOn = @NO;
        testStruct.ambientLightSensorStatus = SDLAmbientLightStatusTwilight3;
        
        expect(testStruct.lowBeamsOn).to(equal(@YES));
        expect(testStruct.highBeamsOn).to(equal(@NO));
        expect(testStruct.ambientLightSensorStatus).to(equal(SDLAmbientLightStatusTwilight3));
    });
    
    it(@"Should get correctly when initialized", ^ {
        NSMutableDictionary* dict = [@{SDLNameLowBeamsOn:@YES,
                                       SDLNameHighBeamsOn:@NO,
                                       SDLNameAmbientLightSensorStatus:SDLAmbientLightStatusTwilight3} mutableCopy];
        SDLHeadLampStatus* testStruct = [[SDLHeadLampStatus alloc] initWithDictionary:dict];
        
        expect(testStruct.lowBeamsOn).to(equal(@YES));
        expect(testStruct.highBeamsOn).to(equal(@NO));
        expect(testStruct.ambientLightSensorStatus).to(equal(SDLAmbientLightStatusTwilight3));
    });
    
    it(@"Should return nil if not set", ^ {
        SDLHeadLampStatus* testStruct = [[SDLHeadLampStatus alloc] init];
        
        expect(testStruct.lowBeamsOn).to(beNil());
        expect(testStruct.highBeamsOn).to(beNil());
        expect(testStruct.ambientLightSensorStatus).to(beNil());
    });
});

QuickSpecEnd