summaryrefslogtreecommitdiff
path: root/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnpublishAppServiceSpec.m
blob: fa2c66c2242fdd0b1eb13a06cfe4bf30e658528e (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
53
54
55
//
//  SDLUnpublishAppServiceSpec.m
//  SmartDeviceLinkTests
//
//  Created by Bretty White on 7/15/19.
//  Copyright © 2019 smartdevicelink. All rights reserved.
//

#import <Foundation/Foundation.h>

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

#import "SDLUnpublishAppService.h"
#import "SDLRPCParameterNames.h"
#import "SDLRPCFunctionNames.h"

QuickSpecBegin(SDLUnpublishAppServiceSpec)

describe(@"Getter/Setter Tests", ^ {
    it(@"Should set and get correctly", ^ {
        SDLUnpublishAppService* testRequest = [[SDLUnpublishAppService alloc] init];
        
        testRequest.serviceID = @"idToUnpublish";
        
        expect(testRequest.serviceID).to(equal(@"idToUnpublish"));
    });
    
    it(@"Should get correctly when initialized", ^ {
        NSDictionary<NSString *, id> *dict = @{SDLRPCParameterNameRequest:
                                                   @{SDLRPCParameterNameParameters:
                                                         @{SDLRPCParameterNameServiceID:@"idToUnpublish"},
                                                     SDLRPCParameterNameOperationName:SDLRPCFunctionNameUnpublishAppService}};
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
        SDLUnpublishAppService* testRequest = [[SDLUnpublishAppService alloc] initWithDictionary:dict];
#pragma clang diagnostic pop
        
        expect(testRequest.serviceID).to(equal(@"idToUnpublish"));
    });
    
    it(@"should properly initialize with serviceID:", ^{
        SDLUnpublishAppService *testRequest = [[SDLUnpublishAppService alloc] initWithServiceID:@"idToUnpublish"];
        
        expect(testRequest.serviceID).to(equal(@"idToUnpublish"));
    });
    
    it(@"Should return nil if not set", ^ {
        SDLUnpublishAppService* testRequest = [[SDLUnpublishAppService alloc] init];
        
        expect(testRequest.serviceID).to(beNil());
    });
});

QuickSpecEnd