summaryrefslogtreecommitdiff
path: root/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLV1ProtocolMessageSpec.m
blob: e546798ac200a9012a6e314bf1594e1ba66b9cc9 (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
//
//  SDLV1ProtocolMessageSpec.m
//  SmartDeviceLink-iOS


#import <Foundation/Foundation.h>

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

#import "SDLV1ProtocolMessage.h"
#import "SDLV1ProtocolHeader.h"


QuickSpecBegin(SDLV1ProtocolMessageSpec)

describe(@"RPCDictionary Tests", ^ {
    it(@"Should return the correct dictionary", ^ {
        SDLV1ProtocolHeader* testHeader = [[SDLV1ProtocolHeader alloc] init];
        NSDictionary* testDictionary = @{@"Oyster": @"Soup",
                                         @"Soup": @"Kitchen",
                                         @"Kitchen": @"Floor",
                                         @"Floor": @"Wax",
                                         @"Wax": @"Museum"};
        SDLV1ProtocolMessage* testMessage = [[SDLV1ProtocolMessage alloc] initWithHeader:testHeader andPayload:[NSJSONSerialization dataWithJSONObject:testDictionary options:0 error:0]];

        expect([testMessage rpcDictionary]).to(equal(testDictionary));
    });
});

QuickSpecEnd