summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2020-12-02 13:50:46 -0500
committerJoel Fischer <joeljfischer@gmail.com>2020-12-02 13:50:46 -0500
commiteb5ab5a29f1e495ca0276d032d62089b786a887f (patch)
tree22c32f9e0a57f38a4c692bf3047f8cc0b510038b
parent305071687eaa660730be619573773306d1365b9a (diff)
downloadsdl_ios-eb5ab5a29f1e495ca0276d032d62089b786a887f.tar.gz
Add test for updating voice commands
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLVoiceCommandManagerSpec.m18
1 files changed, 17 insertions, 1 deletions
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLVoiceCommandManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLVoiceCommandManagerSpec.m
index f969fb05b..8b808273e 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLVoiceCommandManagerSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLVoiceCommandManagerSpec.m
@@ -15,6 +15,12 @@
#import "SDLVoiceCommandUpdateOperation.h"
#import "TestConnectionManager.h"
+@interface SDLVoiceCommandUpdateOperation ()
+
+@property (strong, nonatomic) NSMutableArray<SDLVoiceCommand *> *currentVoiceCommands;
+
+@end
+
@interface SDLVoiceCommand()
@property (assign, nonatomic) UInt32 commandId;
@@ -136,7 +142,17 @@ describe(@"voice command manager", ^{
// when the first operation finishes and updates the current voice commands
describe(@"when the first operation finishes and updates the current voice commands", ^{
- // TODO
+ beforeEach(^{
+ SDLVoiceCommandUpdateOperation *firstOp = testManager.transactionQueue.operations[0];
+ firstOp.currentVoiceCommands = [@[testVoiceCommand2] mutableCopy];
+ [firstOp finishOperation];
+ });
+
+ it(@"should update the second operation", ^{
+ SDLVoiceCommandUpdateOperation *secondOp = testManager.transactionQueue.operations[0];
+
+ expect(secondOp.oldVoiceCommands.firstObject).to(equal(testVoiceCommand2));
+ });
});
});
});