mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 03:32:40 +00:00
Collection of modifiers and subsequent key presses implemented
Extended tests for command creation
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
#import "NSString+Commands.h"
|
||||
#import "MPAutotypeCommand.h"
|
||||
#import "MPAutotypeContext.h"
|
||||
#import "MPAutotypePaste.h"
|
||||
#import "MPAutotypeKeyPress.h"
|
||||
|
||||
#import "KPKEntry.h"
|
||||
|
||||
@@ -47,5 +49,17 @@
|
||||
|
||||
MPAutotypeContext *context = [[MPAutotypeContext alloc] initWithEntry:entry andSequence:@"{USERNAME}{TAB}{PASSWORD}{ENTER}"];
|
||||
NSArray *commands = [MPAutotypeCommand commandsForContext:context];
|
||||
|
||||
XCTAssert([commands count] == 4);
|
||||
XCTAssert([commands[0] isKindOfClass:[MPAutotypePaste class]]);
|
||||
XCTAssert([commands[1] isKindOfClass:[MPAutotypeKeyPress class]]);
|
||||
XCTAssert([commands[2] isKindOfClass:[MPAutotypePaste class]]);
|
||||
XCTAssert([commands[3] isKindOfClass:[MPAutotypeKeyPress class]]);
|
||||
|
||||
context = [[MPAutotypeContext alloc] initWithEntry:entry andSequence:@"^T{USERNAME}%+^{TAB}Whoo{PASSWORD}{ENTER}"];
|
||||
commands = [MPAutotypeCommand commandsForContext:context];
|
||||
|
||||
|
||||
XCTAssert([commands count] == 5);
|
||||
}
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user