blob: 31fad837b39a430ce2520507e2215183cefc7576 (
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
|
//
// SDLOnEncodedSyncPDataSpec.m
// SmartDeviceLink
#import <Foundation/Foundation.h>
#import <Quick/Quick.h>
#import <Nimble/Nimble.h>
#import "SDLOnEncodedSyncPData.h"
#import "SDLNames.h"
QuickSpecBegin(SDLOnEncodedSyncPDataSpec)
describe(@"Getter/Setter Tests", ^ {
it(@"Should set and get correctly", ^ {
SDLOnEncodedSyncPData* testNotification = [[SDLOnEncodedSyncPData alloc] init];
testNotification.data = [@[@0] mutableCopy];
testNotification.URL = @"www.zombo.com";
testNotification.Timeout = @564;
expect(testNotification.data).to(equal([@[@0] mutableCopy]));
expect(testNotification.URL).to(equal(@"www.zombo.com"));
expect(testNotification.Timeout).to(equal(@564));
});
it(@"Should get correctly when initialized", ^ {
NSMutableDictionary* dict = [@{SDLNameNotification:
@{SDLNameParameters:
@{SDLNameData:[@[@0] mutableCopy],
SDLNameUrlUppercase:@"www.zombo.com",
SDLNameTimeoutCapitalized:@564},
SDLNameOperationName:SDLNameOnEncodedSyncPData}} mutableCopy];
SDLOnEncodedSyncPData* testNotification = [[SDLOnEncodedSyncPData alloc] initWithDictionary:dict];
expect(testNotification.data).to(equal([@[@0] mutableCopy]));
expect(testNotification.URL).to(equal(@"www.zombo.com"));
expect(testNotification.Timeout).to(equal(@564));
});
it(@"Should return nil if not set", ^ {
SDLOnEncodedSyncPData* testNotification = [[SDLOnEncodedSyncPData alloc] init];
expect(testNotification.data).to(beNil());
expect(testNotification.URL).to(beNil());
expect(testNotification.Timeout).to(beNil());
});
});
QuickSpecEnd
|