blob: 99c85cdc8e1d58c93d07cb320f4873fdab6159f0 (
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
|
#import <Foundation/Foundation.h>
#import <Quick/Quick.h>
#import <Nimble/Nimble.h>
#import "SDLNavigationCapability.h"
#import "SDLNames.h"
QuickSpecBegin(SDLNavigationCapabilitySpec)
describe(@"Getter/Setter Tests", ^ {
it(@"Should set and get correctly", ^ {
SDLNavigationCapability *testStruct = [[SDLNavigationCapability alloc] init];
testStruct.getWayPointsEnabled = @(YES);
testStruct.sendLocationEnabled = @(YES);
expect(testStruct.getWayPointsEnabled).to(equal(YES));
expect(testStruct.sendLocationEnabled).to(equal(YES));
});
});
describe(@"Initialization tests", ^{
it(@"Should get correctly when initialized with a dictionary", ^ {
NSDictionary *dict = @{SDLNameGetWayPointsEnabled: @(YES),
SDLNameSendLocationEnabled: @(YES)};
SDLNavigationCapability* testStruct = [[SDLNavigationCapability alloc] initWithDictionary:dict];
expect(testStruct.getWayPointsEnabled).to(equal(YES));
expect(testStruct.sendLocationEnabled).to(equal(YES));
});
it(@"Should return nil if not set", ^ {
SDLNavigationCapability* testStruct = [[SDLNavigationCapability alloc] init];
expect(testStruct.getWayPointsEnabled).to(beNil());
expect(testStruct.sendLocationEnabled).to(beNil());
});
it(@"should initialize correctly with initWithSendLocation:waypoints:", ^{
SDLNavigationCapability *testStruct = [[SDLNavigationCapability alloc] initWithSendLocation:YES waypoints:YES];
expect(testStruct.getWayPointsEnabled).to(equal(YES));
expect(testStruct.sendLocationEnabled).to(equal(YES));
});
});
QuickSpecEnd
|