blob: 0eaa6e698257c22a575f16785a9c5c0c39ce65be (
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
53
54
|
//
// SDLVehicleTypeSpec.m
// SmartDeviceLink
#import <Foundation/Foundation.h>
#import <Quick/Quick.h>
#import <Nimble/Nimble.h>
#import "SDLVehicleType.h"
#import "SDLNames.h"
QuickSpecBegin(SDLVehicleTypeSpec)
describe(@"Getter/Setter Tests", ^ {
it(@"Should set and get correctly", ^ {
SDLVehicleType* testStruct = [[SDLVehicleType alloc] init];
testStruct.make = @"Make";
testStruct.model = @"Model";
testStruct.modelYear = @"3.141*10^36";
testStruct.trim = @"AE";
expect(testStruct.make).to(equal(@"Make"));
expect(testStruct.model).to(equal(@"Model"));
expect(testStruct.modelYear).to(equal(@"3.141*10^36"));
expect(testStruct.trim).to(equal(@"AE"));
});
it(@"Should get correctly when initialized", ^ {
NSMutableDictionary* dict = [@{SDLNameMake:@"Make",
SDLNameModel:@"Model",
SDLNameModelYear:@"3.141*10^36",
SDLNameTrim:@"AE"} mutableCopy];
SDLVehicleType* testStruct = [[SDLVehicleType alloc] initWithDictionary:dict];
expect(testStruct.make).to(equal(@"Make"));
expect(testStruct.model).to(equal(@"Model"));
expect(testStruct.modelYear).to(equal(@"3.141*10^36"));
expect(testStruct.trim).to(equal(@"AE"));
});
it(@"Should return nil if not set", ^ {
SDLVehicleType* testStruct = [[SDLVehicleType alloc] init];
expect(testStruct.make).to(beNil());
expect(testStruct.model).to(beNil());
expect(testStruct.modelYear).to(beNil());
expect(testStruct.trim).to(beNil());
});
});
QuickSpecEnd
|