summaryrefslogtreecommitdiff
path: root/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLPresetBankCapabilitiesSpec.m
blob: 16330022f6d2eeb38e027e03ecad2cfca3879fe7 (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
//
//  SDLPresetBankCapabilitiesSpec.m
//  SmartDeviceLink


#import <Foundation/Foundation.h>

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

#import "SDLPresetBankCapabilities.h"
#import "SDLNames.h"

QuickSpecBegin(SDLPresetBankCapabilitiesSpec)

describe(@"Getter/Setter Tests", ^ {
    it(@"Should set and get correctly", ^ {
        SDLPresetBankCapabilities* testStruct = [[SDLPresetBankCapabilities alloc] init];
        
        testStruct.onScreenPresetsAvailable = @NO;
        
        expect(testStruct.onScreenPresetsAvailable).to(equal(@NO));
    });
    
    it(@"Should get correctly when initialized", ^ {
        NSMutableDictionary* dict = [@{SDLNameOnScreenPresetsAvailable:@YES} mutableCopy];
        SDLPresetBankCapabilities* testStruct = [[SDLPresetBankCapabilities alloc] initWithDictionary:dict];
        
        expect(testStruct.onScreenPresetsAvailable).to(equal(@YES));
    });
    
    it(@"Should return nil if not set", ^ {
        SDLPresetBankCapabilities* testStruct = [[SDLPresetBankCapabilities alloc] init];
        
        expect(testStruct.onScreenPresetsAvailable).to(beNil());
    });
});

QuickSpecEnd