summaryrefslogtreecommitdiff
path: root/SmartDeviceLink-iOS/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLECallInfoSpec.m
blob: 28e226187c5a50813b94bada89b290220cf65272 (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
52
//
//  SDLECallInfoSpec.m
//  SmartDeviceLink


#import <Foundation/Foundation.h>

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

#import "SDLVehicleDataNotificationStatus.h"
#import "SDLECallConfirmationStatus.h"
#import "SDLECallInfo.h"
#import "SDLNames.h"


QuickSpecBegin(SDLECallInfoSpec)

describe(@"Getter/Setter Tests", ^ {
    it(@"Should set and get correctly", ^ {
        SDLECallInfo* testStruct = [[SDLECallInfo alloc] init];
        
        testStruct.eCallNotificationStatus = [SDLVehicleDataNotificationStatus NORMAL];
        testStruct.auxECallNotificationStatus = [SDLVehicleDataNotificationStatus ACTIVE];
        testStruct.eCallConfirmationStatus = [SDLECallConfirmationStatus CALL_IN_PROGRESS];
        
        expect(testStruct.eCallNotificationStatus).to(equal([SDLVehicleDataNotificationStatus NORMAL]));
        expect(testStruct.auxECallNotificationStatus).to(equal([SDLVehicleDataNotificationStatus ACTIVE]));
        expect(testStruct.eCallConfirmationStatus).to(equal([SDLECallConfirmationStatus CALL_IN_PROGRESS]));
    });
    
    it(@"Should get correctly when initialized", ^ {
        NSMutableDictionary* dict = [@{NAMES_eCallNotificationStatus:[SDLVehicleDataNotificationStatus NORMAL],
                                       NAMES_auxECallNotificationStatus:[SDLVehicleDataNotificationStatus ACTIVE],
                                       NAMES_eCallConfirmationStatus:[SDLECallConfirmationStatus CALL_IN_PROGRESS]} mutableCopy];
        SDLECallInfo* testStruct = [[SDLECallInfo alloc] initWithDictionary:dict];
        
        expect(testStruct.eCallNotificationStatus).to(equal([SDLVehicleDataNotificationStatus NORMAL]));
        expect(testStruct.auxECallNotificationStatus).to(equal([SDLVehicleDataNotificationStatus ACTIVE]));
        expect(testStruct.eCallConfirmationStatus).to(equal([SDLECallConfirmationStatus CALL_IN_PROGRESS]));
    });
    
    it(@"Should return nil if not set", ^ {
        SDLECallInfo* testStruct = [[SDLECallInfo alloc] init];
        
        expect(testStruct.eCallNotificationStatus).to(beNil());
        expect(testStruct.auxECallNotificationStatus).to(beNil());
        expect(testStruct.eCallConfirmationStatus).to(beNil());
    });
});

QuickSpecEnd