summaryrefslogtreecommitdiff
path: root/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingFormatSpec.m
blob: 551110ee8c819d946e8de80906b10936467bcabc (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
//
//  SDLVideoStreamingFormatSpec.m
//  SmartDeviceLink-iOS
//
//  Created by Brett McIsaac on 7/28/17.
//  Copyright © 2017 smartdevicelink. All rights reserved.
//

#import <Foundation/Foundation.h>

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

#import "SDLNames.h"
#import "SDLVideoStreamingCodec.h"
#import "SDLVideoStreamingFormat.h"
#import "SDLVideoStreamingProtocol.h"

QuickSpecBegin(SDLVideoStreamingFormatSpec)

describe(@"Initialization tests", ^{
    it(@"Should get correctly when initialized with a dictionary", ^ {
        NSMutableDictionary* dict = [@{SDLNameVideoProtocol: SDLVideoStreamingProtocolRAW,
                                       SDLNameVideoCodec: SDLVideoStreamingCodecH264} mutableCopy];
        SDLVideoStreamingFormat* testStruct = [[SDLVideoStreamingFormat alloc] initWithDictionary:dict];

        expect(testStruct.protocol).to(equal(SDLVideoStreamingProtocolRAW));
        expect(testStruct.codec).to(equal(SDLVideoStreamingCodecH264));
    });

    it(@"Should return nil if not set", ^ {
        SDLVideoStreamingFormat* testStruct = [[SDLVideoStreamingFormat alloc] init];

        expect(testStruct.protocol).to(beNil());
        expect(testStruct.codec).to(beNil());
    });
});

QuickSpecEnd