summaryrefslogtreecommitdiff
path: root/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetDTCsSpec.m
blob: d3373093c5228e8045fc6290bfd67044fc773a3b (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
//
//  SDLGetDTCsSpec.m
//  SmartDeviceLink


#import <Foundation/Foundation.h>

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

#import "SDLGetDTCs.h"
#import "SDLNames.h"

QuickSpecBegin(SDLGetDTCsSpec)

describe(@"Getter/Setter Tests", ^ {
    it(@"Should set and get correctly", ^ {
        SDLGetDTCs* testRequest = [[SDLGetDTCs alloc] init];
        
		testRequest.ecuName = @4321;
		testRequest.dtcMask = @22;

		expect(testRequest.ecuName).to(equal(@4321));
		expect(testRequest.dtcMask).to(equal(@22));
    });
    
    it(@"Should get correctly when initialized", ^ {
        NSMutableDictionary* dict = [@{SDLNameRequest:
                                           @{SDLNameParameters:
                                                 @{SDLNameEcuName:@4321,
                                                   SDLNameDtcMask:@22},
                                             SDLNameOperationName:SDLNameEndAudioPassThru}} mutableCopy];
        SDLGetDTCs* testRequest = [[SDLGetDTCs alloc] initWithDictionary:dict];
        
        expect(testRequest.ecuName).to(equal(@4321));
        expect(testRequest.dtcMask).to(equal(@22));
    });

    it(@"Should return nil if not set", ^ {
        SDLGetDTCs* testRequest = [[SDLGetDTCs alloc] init];
        
		expect(testRequest.ecuName).to(beNil());
		expect(testRequest.dtcMask).to(beNil());
	});
});

QuickSpecEnd