blob: 2e553a218bb563d02a58b86f4acf3ee602f98db8 (
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 = [@{SDLNameECallNotificationStatus:[SDLVehicleDataNotificationStatus NORMAL],
SDLNameAuxECallNotificationStatus:[SDLVehicleDataNotificationStatus ACTIVE],
SDLNameECallConfirmationStatus:[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
|