summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2020-06-04 13:47:11 -0400
committerJoel Fischer <joeljfischer@gmail.com>2020-06-04 13:47:11 -0400
commitb51c3f22707365a175661afc23455b6226cd2a0d (patch)
tree72eb48b57e6866eaaf2d2f3d1fca0b2dd49d7c03
parenta9bf1e9db17ef8baac590e6ca465cc2a8410a383 (diff)
downloadsdl_ios-b51c3f22707365a175661afc23455b6226cd2a0d.tar.gz
Add tests for new manager delegate method
-rw-r--r--SmartDeviceLink-iOS.xcodeproj/project.pbxproj20
-rw-r--r--SmartDeviceLink/SDLLifecycleConfigurationUpdate.m4
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m173
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/TestOldConfigurationUpdateManagerDelegate.h19
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/TestOldConfigurationUpdateManagerDelegate.m21
-rw-r--r--SmartDeviceLinkTests/TestNewConfigurationUpdateManagerDelegate.h19
-rw-r--r--SmartDeviceLinkTests/TestNewConfigurationUpdateManagerDelegate.m21
7 files changed, 232 insertions, 45 deletions
diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
index 378ad6ac0..91b4f85a9 100644
--- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
+++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj
@@ -416,6 +416,8 @@
2BF2F85220ED068200A26EF2 /* SDLAudioStreamingIndicatorSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 2BF2F85120ED068200A26EF2 /* SDLAudioStreamingIndicatorSpec.m */; };
332A914F1CED9CC60043824C /* SDLAppInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 332A913D1CED87F80043824C /* SDLAppInfo.m */; };
332A91501CED9CF10043824C /* SDLAppInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 332A913C1CED87F80043824C /* SDLAppInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 4A4AD8A424894260008FC414 /* TestOldConfigurationUpdateManagerDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A4AD8A324894260008FC414 /* TestOldConfigurationUpdateManagerDelegate.m */; };
+ 4A4AD8A724894270008FC414 /* TestNewConfigurationUpdateManagerDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A4AD8A624894270008FC414 /* TestNewConfigurationUpdateManagerDelegate.m */; };
4A99D00E247576B7009B43E6 /* SDLTextField+ScreenManagerExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A99D00C247576B7009B43E6 /* SDLTextField+ScreenManagerExtensions.h */; };
4A99D00F247576B7009B43E6 /* SDLTextField+ScreenManagerExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A99D00D247576B7009B43E6 /* SDLTextField+ScreenManagerExtensions.m */; };
4A99D0122475773C009B43E6 /* SDLImageField+ScreenManagerExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A99D0102475773C009B43E6 /* SDLImageField+ScreenManagerExtensions.h */; };
@@ -2131,6 +2133,10 @@
2BF2F85120ED068200A26EF2 /* SDLAudioStreamingIndicatorSpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLAudioStreamingIndicatorSpec.m; sourceTree = "<group>"; };
332A913C1CED87F80043824C /* SDLAppInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLAppInfo.h; sourceTree = "<group>"; };
332A913D1CED87F80043824C /* SDLAppInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAppInfo.m; sourceTree = "<group>"; };
+ 4A4AD8A224894260008FC414 /* TestOldConfigurationUpdateManagerDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TestOldConfigurationUpdateManagerDelegate.h; path = DevAPISpecs/TestOldConfigurationUpdateManagerDelegate.h; sourceTree = "<group>"; };
+ 4A4AD8A324894260008FC414 /* TestOldConfigurationUpdateManagerDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = TestOldConfigurationUpdateManagerDelegate.m; path = DevAPISpecs/TestOldConfigurationUpdateManagerDelegate.m; sourceTree = "<group>"; };
+ 4A4AD8A524894270008FC414 /* TestNewConfigurationUpdateManagerDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestNewConfigurationUpdateManagerDelegate.h; sourceTree = "<group>"; };
+ 4A4AD8A624894270008FC414 /* TestNewConfigurationUpdateManagerDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TestNewConfigurationUpdateManagerDelegate.m; sourceTree = "<group>"; };
4A99D00C247576B7009B43E6 /* SDLTextField+ScreenManagerExtensions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SDLTextField+ScreenManagerExtensions.h"; sourceTree = "<group>"; };
4A99D00D247576B7009B43E6 /* SDLTextField+ScreenManagerExtensions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "SDLTextField+ScreenManagerExtensions.m"; sourceTree = "<group>"; };
4A99D0102475773C009B43E6 /* SDLImageField+ScreenManagerExtensions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SDLImageField+ScreenManagerExtensions.h"; sourceTree = "<group>"; };
@@ -3985,6 +3991,17 @@
path = MessageSpecs;
sourceTree = "<group>";
};
+ 4A4AD8A12489422F008FC414 /* Utilities */ = {
+ isa = PBXGroup;
+ children = (
+ 4A4AD8A224894260008FC414 /* TestOldConfigurationUpdateManagerDelegate.h */,
+ 4A4AD8A324894260008FC414 /* TestOldConfigurationUpdateManagerDelegate.m */,
+ 4A4AD8A524894270008FC414 /* TestNewConfigurationUpdateManagerDelegate.h */,
+ 4A4AD8A624894270008FC414 /* TestNewConfigurationUpdateManagerDelegate.m */,
+ );
+ name = Utilities;
+ sourceTree = "<group>";
+ };
5D0218EB1A8E795700D1BF62 /* UI */ = {
isa = PBXGroup;
children = (
@@ -4088,6 +4105,7 @@
5D1654541D3E753100554D93 /* Lifecycle */ = {
isa = PBXGroup;
children = (
+ 4A4AD8A12489422F008FC414 /* Utilities */,
5D1654551D3E754F00554D93 /* SDLLifecycleManagerSpec.m */,
888F86FF221DF4880052FE4C /* SDLAsynchronousRPCOperationSpec.m */,
5D60DF23202B7A80001EDA01 /* SDLAsynchronousRPCRequestOperationSpec.m */,
@@ -7930,6 +7948,7 @@
1EAA47722036AEF5000FE74B /* SDLLightNameSpec.m in Sources */,
5DB92D2F1AC59F0000C15BB0 /* SDLObjectWithPrioritySpec.m in Sources */,
88DF999122035D5A00477AC1 /* SDLIAPTransportSpec.m in Sources */,
+ 4A4AD8A424894260008FC414 /* TestOldConfigurationUpdateManagerDelegate.m in Sources */,
162E838A1A9BDE8B00906325 /* SDLSingleTireStatusSpec.m in Sources */,
5D6EB4CC1BF28DC600693731 /* NSMapTable+SubscriptingSpec.m in Sources */,
88F37A4D226F84BE00DF119B /* SDLIAPDataSessionSpec.m in Sources */,
@@ -8211,6 +8230,7 @@
162E838F1A9BDE8B00906325 /* SDLTextFieldSpec.m in Sources */,
8818ADDD2100FE0C007D6F19 /* SDLTurnSignalSpec.m in Sources */,
162E82CA1A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m in Sources */,
+ 4A4AD8A724894270008FC414 /* TestNewConfigurationUpdateManagerDelegate.m in Sources */,
162E83091A9BDE8B00906325 /* SDLVehicleDataStatusSpec.m in Sources */,
5DAD5F8D20508F220025624C /* SDLSoftButtonManagerSpec.m in Sources */,
162E83741A9BDE8B00906325 /* SDLBodyInformationSpec.m in Sources */,
diff --git a/SmartDeviceLink/SDLLifecycleConfigurationUpdate.m b/SmartDeviceLink/SDLLifecycleConfigurationUpdate.m
index b81b14d03..b86688445 100644
--- a/SmartDeviceLink/SDLLifecycleConfigurationUpdate.m
+++ b/SmartDeviceLink/SDLLifecycleConfigurationUpdate.m
@@ -25,4 +25,8 @@
return self;
}
+- (NSString *)description {
+ return [NSString stringWithFormat:@"Lifecycle Configuration Update: new app name: %@, new short app name: %@, new tts name: %@, new voice commands: %@", self.appName, self.shortAppName, self.ttsName, self.voiceRecognitionCommandNames];
+}
+
@end
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m
index cda5285c4..f2f1f0374 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m
@@ -42,6 +42,9 @@
#import "SDLVersion.h"
#import "SDLVideoStreamingState.h"
+#import "TestOldConfigurationUpdateManagerDelegate.h"
+#import "TestNewConfigurationUpdateManagerDelegate.h"
+
// Ignore the deprecated proxy methods
#pragma clang diagnostic push
@@ -425,57 +428,137 @@ describe(@"a lifecycle manager", ^{
});
context(@"when the register response returns different language than the one passed with the lifecycle configuration", ^{
- beforeEach(^{
- expect(testManager.configuration.lifecycleConfig.appName).to(equal(testConfig.lifecycleConfig.appName));
- expect(testManager.configuration.lifecycleConfig.shortAppName).to(equal(testConfig.lifecycleConfig.shortAppName));
- expect(testManager.configuration.lifecycleConfig.ttsName).to(beNil());
- expect(testManager.configuration.lifecycleConfig.language).to(equal(testConfig.lifecycleConfig.language));
- expect(testManager.configuration.lifecycleConfig.languagesSupported).to(equal(testConfig.lifecycleConfig.languagesSupported));
- });
-
- it(@"should should update the configuration when the app supports the head unit language", ^{
- SDLRegisterAppInterfaceResponse *registerAppInterfaceResponse = [[SDLRegisterAppInterfaceResponse alloc] init];
- registerAppInterfaceResponse.success = @YES;
- registerAppInterfaceResponse.resultCode = SDLResultWrongLanguage;
- registerAppInterfaceResponse.info = @"Language mismatch";
- registerAppInterfaceResponse.language = SDLLanguageEnGb;
- testManager.registerResponse = registerAppInterfaceResponse;
-
- SDLLifecycleConfigurationUpdate *update = [[SDLLifecycleConfigurationUpdate alloc] initWithAppName:@"EnGb" shortAppName:@"E" ttsName:[SDLTTSChunk textChunksFromString:@"EnGb ttsName"] voiceRecognitionCommandNames:nil];
- OCMStub([testManager.delegate managerShouldUpdateLifecycleToLanguage:[OCMArg any]]).andReturn(update);
-
- setToStateWithEnterTransition(SDLLifecycleStateRegistered, SDLLifecycleStateUpdatingConfiguration);
- // Transition to StateSettingUpManagers to prevent assert error from the lifecycle machine
- [testManager.lifecycleStateMachine setToState:SDLLifecycleStateSettingUpManagers fromOldState:SDLLifecycleStateUpdatingConfiguration callEnterTransition:NO];
-
- expect(testManager.configuration.lifecycleConfig.language).toEventually(equal(SDLLanguageEnGb));
- expect(testManager.configuration.lifecycleConfig.appName).toEventually(equal(@"EnGb"));
- expect(testManager.configuration.lifecycleConfig.shortAppName).toEventually(equal(@"E"));
- expect(testManager.configuration.lifecycleConfig.ttsName).toEventually(equal([SDLTTSChunk textChunksFromString:@"EnGb ttsName"]));
-
- OCMVerify([testManager.delegate managerShouldUpdateLifecycleToLanguage:[OCMArg any]]);
+ context(@"using the deprecated delegate method", ^{
+ __block TestOldConfigurationUpdateManagerDelegate *oldDelegate = nil;
+ beforeEach(^{
+ oldDelegate = OCMClassMock([TestOldConfigurationUpdateManagerDelegate class]);
+ testManager.delegate = oldDelegate;
+ });
+
+ it(@"should should update the configuration when the app supports the head unit language", ^{
+ SDLRegisterAppInterfaceResponse *registerAppInterfaceResponse = [[SDLRegisterAppInterfaceResponse alloc] init];
+ registerAppInterfaceResponse.success = @YES;
+ registerAppInterfaceResponse.resultCode = SDLResultWrongLanguage;
+ registerAppInterfaceResponse.info = @"Language mismatch";
+ registerAppInterfaceResponse.language = SDLLanguageEnGb;
+ registerAppInterfaceResponse.hmiDisplayLanguage = SDLLanguageEnGb;
+ testManager.registerResponse = registerAppInterfaceResponse;
+
+ SDLLifecycleConfigurationUpdate *update = [[SDLLifecycleConfigurationUpdate alloc] initWithAppName:@"EnGb" shortAppName:@"E" ttsName:[SDLTTSChunk textChunksFromString:@"EnGb ttsName"] voiceRecognitionCommandNames:nil];
+ OCMStub([testManager.delegate managerShouldUpdateLifecycleToLanguage:[OCMArg any]]).andReturn(update);
+
+ setToStateWithEnterTransition(SDLLifecycleStateRegistered, SDLLifecycleStateUpdatingConfiguration);
+ // Transition to StateSettingUpManagers to prevent assert error from the lifecycle machine
+ [testManager.lifecycleStateMachine setToState:SDLLifecycleStateSettingUpManagers fromOldState:SDLLifecycleStateUpdatingConfiguration callEnterTransition:NO];
+
+ expect(testManager.configuration.lifecycleConfig.language).toEventually(equal(SDLLanguageEnGb));
+ expect(testManager.configuration.lifecycleConfig.appName).toEventually(equal(@"EnGb"));
+ expect(testManager.configuration.lifecycleConfig.shortAppName).toEventually(equal(@"E"));
+ expect(testManager.configuration.lifecycleConfig.ttsName).toEventually(equal([SDLTTSChunk textChunksFromString:@"EnGb ttsName"]));
+
+ OCMVerify([testManager.delegate managerShouldUpdateLifecycleToLanguage:[OCMArg any]]);
+ });
+
+ it(@"should not update the configuration when the app does not support the head unit language", ^{
+ SDLRegisterAppInterfaceResponse *registerAppInterfaceResponse = [[SDLRegisterAppInterfaceResponse alloc] init];
+ registerAppInterfaceResponse.success = @YES;
+ registerAppInterfaceResponse.resultCode = SDLResultWrongLanguage;
+ registerAppInterfaceResponse.info = @"Language mismatch";
+ registerAppInterfaceResponse.language = SDLLanguageDeDe;
+ registerAppInterfaceResponse.hmiDisplayLanguage = SDLLanguageDeDe;
+ testManager.registerResponse = registerAppInterfaceResponse;
+
+ OCMStub([testManager.delegate managerShouldUpdateLifecycleToLanguage:[OCMArg any]]).andReturn(nil);
+
+ setToStateWithEnterTransition(SDLLifecycleStateRegistered, SDLLifecycleStateUpdatingConfiguration);
+ // Transition to StateSettingUpManagers to prevent assert error from the lifecycle machine
+ [testManager.lifecycleStateMachine setToState:SDLLifecycleStateSettingUpManagers fromOldState:SDLLifecycleStateUpdatingConfiguration callEnterTransition:NO];
+
+ expect(testManager.configuration.lifecycleConfig.language).toEventually(equal(SDLLanguageEnUs));
+ expect(testManager.configuration.lifecycleConfig.appName).toEventually(equal(@"Test App"));
+ expect(testManager.configuration.lifecycleConfig.shortAppName).toEventually(equal(@"Short Name"));
+ expect(testManager.configuration.lifecycleConfig.ttsName).toEventually(beNil());
+
+ OCMVerify([testManager.delegate managerShouldUpdateLifecycleToLanguage:[OCMArg any]]);
+ });
});
- it(@"should not update the configuration when the app does not support the head unit language", ^{
- SDLRegisterAppInterfaceResponse *registerAppInterfaceResponse = [[SDLRegisterAppInterfaceResponse alloc] init];
- registerAppInterfaceResponse.success = @YES;
- registerAppInterfaceResponse.resultCode = SDLResultWrongLanguage;
- registerAppInterfaceResponse.info = @"Language mismatch";
- registerAppInterfaceResponse.language = SDLLanguageDeDe;
- testManager.registerResponse = registerAppInterfaceResponse;
+ context(@"using the updated delegate method", ^{
+ __block TestNewConfigurationUpdateManagerDelegate *newDelegate = nil;
+ beforeEach(^{
+ newDelegate = OCMClassMock([TestNewConfigurationUpdateManagerDelegate class]);
+ testManager.delegate = newDelegate;
+ });
+
+ it(@"should should update the configuration when the app supports the head unit language", ^{
+ SDLRegisterAppInterfaceResponse *registerAppInterfaceResponse = [[SDLRegisterAppInterfaceResponse alloc] init];
+ registerAppInterfaceResponse.success = @YES;
+ registerAppInterfaceResponse.resultCode = SDLResultWrongLanguage;
+ registerAppInterfaceResponse.info = @"Language mismatch";
+ registerAppInterfaceResponse.language = SDLLanguageEnGb;
+ registerAppInterfaceResponse.hmiDisplayLanguage = SDLLanguageEnGb;
+ testManager.registerResponse = registerAppInterfaceResponse;
+
+ SDLLifecycleConfigurationUpdate *update = [[SDLLifecycleConfigurationUpdate alloc] initWithAppName:@"EnGb" shortAppName:@"E" ttsName:[SDLTTSChunk textChunksFromString:@"EnGb ttsName"] voiceRecognitionCommandNames:nil];
+ OCMStub([testManager.delegate managerShouldUpdateLifecycleToLanguage:[OCMArg any] hmiLanguage:[OCMArg any]]).andReturn(update);
+
+ setToStateWithEnterTransition(SDLLifecycleStateRegistered, SDLLifecycleStateUpdatingConfiguration);
+ // Transition to StateSettingUpManagers to prevent assert error from the lifecycle machine
+ [testManager.lifecycleStateMachine setToState:SDLLifecycleStateSettingUpManagers fromOldState:SDLLifecycleStateUpdatingConfiguration callEnterTransition:NO];
+
+ expect(testManager.configuration.lifecycleConfig.language).toEventually(equal(SDLLanguageEnGb));
+ expect(testManager.configuration.lifecycleConfig.appName).toEventually(equal(@"EnGb"));
+ expect(testManager.configuration.lifecycleConfig.shortAppName).toEventually(equal(@"E"));
+ expect(testManager.configuration.lifecycleConfig.ttsName).toEventually(equal([SDLTTSChunk textChunksFromString:@"EnGb ttsName"]));
+
+ OCMVerify([testManager.delegate managerShouldUpdateLifecycleToLanguage:[OCMArg any] hmiLanguage:[OCMArg any]]);
+ });
- OCMStub([testManager.delegate managerShouldUpdateLifecycleToLanguage:[OCMArg any]]).andReturn(nil);
+ it(@"should not update the configuration when the app does not support the head unit language", ^{
+ SDLRegisterAppInterfaceResponse *registerAppInterfaceResponse = [[SDLRegisterAppInterfaceResponse alloc] init];
+ registerAppInterfaceResponse.success = @YES;
+ registerAppInterfaceResponse.resultCode = SDLResultWrongLanguage;
+ registerAppInterfaceResponse.info = @"Language mismatch";
+ registerAppInterfaceResponse.language = SDLLanguageDeDe;
+ registerAppInterfaceResponse.hmiDisplayLanguage = SDLLanguageDeDe;
+ testManager.registerResponse = registerAppInterfaceResponse;
- setToStateWithEnterTransition(SDLLifecycleStateRegistered, SDLLifecycleStateUpdatingConfiguration);
- // Transition to StateSettingUpManagers to prevent assert error from the lifecycle machine
- [testManager.lifecycleStateMachine setToState:SDLLifecycleStateSettingUpManagers fromOldState:SDLLifecycleStateUpdatingConfiguration callEnterTransition:NO];
+ OCMStub([testManager.delegate managerShouldUpdateLifecycleToLanguage:[OCMArg any] hmiLanguage:[OCMArg any]]).andReturn(nil);
- expect(testManager.configuration.lifecycleConfig.language).toEventually(equal(SDLLanguageEnUs));
- expect(testManager.configuration.lifecycleConfig.appName).toEventually(equal(@"Test App"));
- expect(testManager.configuration.lifecycleConfig.shortAppName).toEventually(equal(@"Short Name"));
- expect(testManager.configuration.lifecycleConfig.ttsName).toEventually(beNil());
+ setToStateWithEnterTransition(SDLLifecycleStateRegistered, SDLLifecycleStateUpdatingConfiguration);
+ // Transition to StateSettingUpManagers to prevent assert error from the lifecycle machine
+ [testManager.lifecycleStateMachine setToState:SDLLifecycleStateSettingUpManagers fromOldState:SDLLifecycleStateUpdatingConfiguration callEnterTransition:NO];
- OCMVerify([testManager.delegate managerShouldUpdateLifecycleToLanguage:[OCMArg any]]);
+ expect(testManager.configuration.lifecycleConfig.language).toEventually(equal(SDLLanguageEnUs));
+ expect(testManager.configuration.lifecycleConfig.appName).toEventually(equal(@"Test App"));
+ expect(testManager.configuration.lifecycleConfig.shortAppName).toEventually(equal(@"Short Name"));
+ expect(testManager.configuration.lifecycleConfig.ttsName).toEventually(beNil());
+
+ OCMVerify([testManager.delegate managerShouldUpdateLifecycleToLanguage:[OCMArg any] hmiLanguage:[OCMArg any]]);
+ });
+
+ it(@"should update if the hmi display language changes", ^{
+ SDLRegisterAppInterfaceResponse *registerAppInterfaceResponse = [[SDLRegisterAppInterfaceResponse alloc] init];
+ registerAppInterfaceResponse.success = @YES;
+ registerAppInterfaceResponse.resultCode = SDLResultWrongLanguage;
+ registerAppInterfaceResponse.info = @"Language mismatch";
+ registerAppInterfaceResponse.language = SDLLanguageEnUs;
+ registerAppInterfaceResponse.hmiDisplayLanguage = SDLLanguageEnGb;
+ testManager.registerResponse = registerAppInterfaceResponse;
+
+ OCMStub([testManager.delegate managerShouldUpdateLifecycleToLanguage:[OCMArg any] hmiLanguage:[OCMArg any]]).andReturn(nil);
+
+ setToStateWithEnterTransition(SDLLifecycleStateRegistered, SDLLifecycleStateUpdatingConfiguration);
+ // Transition to StateSettingUpManagers to prevent assert error from the lifecycle machine
+ [testManager.lifecycleStateMachine setToState:SDLLifecycleStateSettingUpManagers fromOldState:SDLLifecycleStateUpdatingConfiguration callEnterTransition:NO];
+
+ expect(testManager.configuration.lifecycleConfig.language).toEventually(equal(SDLLanguageEnUs));
+ expect(testManager.configuration.lifecycleConfig.appName).toEventually(equal(@"Test App"));
+ expect(testManager.configuration.lifecycleConfig.shortAppName).toEventually(equal(@"Short Name"));
+ expect(testManager.configuration.lifecycleConfig.ttsName).toEventually(beNil());
+
+ OCMVerify([testManager.delegate managerShouldUpdateLifecycleToLanguage:[OCMArg any] hmiLanguage:[OCMArg any]]);
+ });
});
});
});
diff --git a/SmartDeviceLinkTests/DevAPISpecs/TestOldConfigurationUpdateManagerDelegate.h b/SmartDeviceLinkTests/DevAPISpecs/TestOldConfigurationUpdateManagerDelegate.h
new file mode 100644
index 000000000..f527decea
--- /dev/null
+++ b/SmartDeviceLinkTests/DevAPISpecs/TestOldConfigurationUpdateManagerDelegate.h
@@ -0,0 +1,19 @@
+//
+// TestOldConfigurationUpdateManagerDelegate.h
+// SmartDeviceLinkTests
+//
+// Created by Joel Fischer on 6/4/20.
+// Copyright © 2020 smartdevicelink. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import "SDLManagerDelegate.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface TestOldConfigurationUpdateManagerDelegate : NSObject <SDLManagerDelegate>
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLinkTests/DevAPISpecs/TestOldConfigurationUpdateManagerDelegate.m b/SmartDeviceLinkTests/DevAPISpecs/TestOldConfigurationUpdateManagerDelegate.m
new file mode 100644
index 000000000..08a6626d4
--- /dev/null
+++ b/SmartDeviceLinkTests/DevAPISpecs/TestOldConfigurationUpdateManagerDelegate.m
@@ -0,0 +1,21 @@
+//
+// TestOldConfigurationUpdateManagerDelegate.m
+// SmartDeviceLinkTests
+//
+// Created by Joel Fischer on 6/4/20.
+// Copyright © 2020 smartdevicelink. All rights reserved.
+//
+
+#import "TestOldConfigurationUpdateManagerDelegate.h"
+
+@implementation TestOldConfigurationUpdateManagerDelegate
+
+- (void)hmiLevel:(nonnull SDLHMILevel)oldLevel didChangeToLevel:(nonnull SDLHMILevel)newLevel { }
+
+- (void)managerDidDisconnect { }
+
+- (nullable SDLLifecycleConfigurationUpdate *)managerShouldUpdateLifecycleToLanguage:(SDLLanguage)language {
+ return nil;
+}
+
+@end
diff --git a/SmartDeviceLinkTests/TestNewConfigurationUpdateManagerDelegate.h b/SmartDeviceLinkTests/TestNewConfigurationUpdateManagerDelegate.h
new file mode 100644
index 000000000..67e3c8948
--- /dev/null
+++ b/SmartDeviceLinkTests/TestNewConfigurationUpdateManagerDelegate.h
@@ -0,0 +1,19 @@
+//
+// TestNewConfigurationUpdateManagerDelegate.h
+// SmartDeviceLinkTests
+//
+// Created by Joel Fischer on 6/4/20.
+// Copyright © 2020 smartdevicelink. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import "SDLManagerDelegate.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface TestNewConfigurationUpdateManagerDelegate : NSObject <SDLManagerDelegate>
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLinkTests/TestNewConfigurationUpdateManagerDelegate.m b/SmartDeviceLinkTests/TestNewConfigurationUpdateManagerDelegate.m
new file mode 100644
index 000000000..fee42d105
--- /dev/null
+++ b/SmartDeviceLinkTests/TestNewConfigurationUpdateManagerDelegate.m
@@ -0,0 +1,21 @@
+//
+// TestNewConfigurationUpdateManagerDelegate.m
+// SmartDeviceLinkTests
+//
+// Created by Joel Fischer on 6/4/20.
+// Copyright © 2020 smartdevicelink. All rights reserved.
+//
+
+#import "TestNewConfigurationUpdateManagerDelegate.h"
+
+@implementation TestNewConfigurationUpdateManagerDelegate
+
+- (void)hmiLevel:(nonnull SDLHMILevel)oldLevel didChangeToLevel:(nonnull SDLHMILevel)newLevel { }
+
+- (void)managerDidDisconnect { }
+
+- (nullable SDLLifecycleConfigurationUpdate *)managerShouldUpdateLifecycleToLanguage:(SDLLanguage)language hmiLanguage:(SDLLanguage)hmiLanguage {
+ return nil;
+}
+
+@end