diff options
author | NicoleYarroch <nicole@livio.io> | 2020-07-20 16:19:31 -0400 |
---|---|---|
committer | NicoleYarroch <nicole@livio.io> | 2020-07-20 16:19:31 -0400 |
commit | e9b134526ffde9ca25b2c20682f259dcfa81b7a9 (patch) | |
tree | 720fb57972e031f4d5b40905e4ab2de1904f6260 | |
parent | c217e24041c90131e72bf9a43ffcf711bad58f50 (diff) | |
download | sdl_ios-e9b134526ffde9ca25b2c20682f259dcfa81b7a9.tar.gz |
Added missing tests
Signed-off-by: NicoleYarroch <nicole@livio.io>
-rw-r--r-- | SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleProtocolHandlerSpec.m | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleProtocolHandlerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleProtocolHandlerSpec.m index dce778e51..b6da34f74 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleProtocolHandlerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleProtocolHandlerSpec.m @@ -150,6 +150,20 @@ describe(@"SDLLifecycleProtocolHandler tests", ^{ }); }); + context(@"no response from the module to the RPC Start Service", ^{ + beforeEach(^{ + testHandler.rpcStartServiceTimeoutTimer = nil; + }); + + it(@"should send a transport disconnected notification when the timer elapses", ^{ + OCMExpect([mockNotificationDispatcher postNotificationName:[OCMArg isEqual:SDLTransportDidDisconnect] infoObject:[OCMArg isNil]]); + + [testHandler onProtocolOpened:mockProtocol]; + + OCMVerifyAllWithDelay(mockNotificationDispatcher, 11.0); + }); + }); + context(@"of an RPC End Service ACK", ^{ beforeEach(^{ SDLProtocolHeader *header = [SDLProtocolHeader headerForVersion:4]; @@ -169,6 +183,23 @@ describe(@"SDLLifecycleProtocolHandler tests", ^{ }); }); + context(@"of an RPC End Service NAK", ^{ + beforeEach(^{ + SDLProtocolHeader *header = [SDLProtocolHeader headerForVersion:4]; + header.serviceType = SDLServiceTypeRPC; + header.frameData = SDLFrameInfoEndServiceNACK; + SDLProtocolMessage *message = [SDLProtocolMessage messageWithHeader:header andPayload:nil]; + + OCMExpect([mockNotificationDispatcher postNotificationName:[OCMArg isEqual:SDLRPCServiceConnectionDidError] infoObject:[OCMArg any]]); + + [testHandler handleProtocolEndServiceNAKMessage:message protocol:mockProtocol]; + }); + + it(@"should send a RPC service connection error notification", ^{ + OCMVerifyAll(mockNotificationDispatcher); + }); + }); + context(@"of a protocol message", ^{ beforeEach(^{ SDLShow *showRPC = [[SDLShow alloc] initWithMainField1:@"Test1" mainField2:@"Test2" alignment:SDLTextAlignmentLeft]; |