mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 13:32:22 +00:00
Added KeePassKit dependency to MacPassTest
This commit is contained in:
@@ -108,6 +108,7 @@
|
|||||||
4C4B7EEE17A467E1000234C7 /* MPGroupInspectorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4B7EEC17A467E1000234C7 /* MPGroupInspectorViewController.m */; };
|
4C4B7EEE17A467E1000234C7 /* MPGroupInspectorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4B7EEC17A467E1000234C7 /* MPGroupInspectorViewController.m */; };
|
||||||
4C4B7EF317A467FC000234C7 /* MPEntryInspectorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4B7EF117A467FC000234C7 /* MPEntryInspectorViewController.m */; };
|
4C4B7EF317A467FC000234C7 /* MPEntryInspectorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4B7EF117A467FC000234C7 /* MPEntryInspectorViewController.m */; };
|
||||||
4C4B7EF817A4B335000234C7 /* MPUniqueCharactersFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4B7EF717A4B335000234C7 /* MPUniqueCharactersFormatter.m */; };
|
4C4B7EF817A4B335000234C7 /* MPUniqueCharactersFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4B7EF717A4B335000234C7 /* MPUniqueCharactersFormatter.m */; };
|
||||||
|
4C4DC0A61C3AD17500DE9DCF /* KeePassKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C7B63791C0CB55600D7038C /* KeePassKit.framework */; };
|
||||||
4C4F72D118DF704400E8D378 /* DDHotKeyTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4F72CF18DF704400E8D378 /* DDHotKeyTextField.m */; };
|
4C4F72D118DF704400E8D378 /* DDHotKeyTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4F72CF18DF704400E8D378 /* DDHotKeyTextField.m */; };
|
||||||
4C4FCE15177CFE6B00BBF7AE /* MPCustomFieldTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4FCE14177CFE6B00BBF7AE /* MPCustomFieldTableCellView.m */; };
|
4C4FCE15177CFE6B00BBF7AE /* MPCustomFieldTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4FCE14177CFE6B00BBF7AE /* MPCustomFieldTableCellView.m */; };
|
||||||
4C52A88E1788628B00868229 /* 06_BlockDeviceTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C52A88B1788628B00868229 /* 06_BlockDeviceTemplate.pdf */; };
|
4C52A88E1788628B00868229 /* 06_BlockDeviceTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C52A88B1788628B00868229 /* 06_BlockDeviceTemplate.pdf */; };
|
||||||
@@ -721,6 +722,7 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
4C4DC0A61C3AD17500DE9DCF /* KeePassKit.framework in Frameworks */,
|
||||||
4C473A8718AFD85B0073FD2E /* XCTest.framework in Frameworks */,
|
4C473A8718AFD85B0073FD2E /* XCTest.framework in Frameworks */,
|
||||||
4C45FB1D178E09ED0010007D /* Cocoa.framework in Frameworks */,
|
4C45FB1D178E09ED0010007D /* Cocoa.framework in Frameworks */,
|
||||||
);
|
);
|
||||||
@@ -2010,6 +2012,7 @@
|
|||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(DEVELOPER_FRAMEWORKS_DIR)",
|
"$(DEVELOPER_FRAMEWORKS_DIR)",
|
||||||
|
"$(PROJECT_DIR)/Carthage/Build/Mac",
|
||||||
);
|
);
|
||||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||||
GCC_PREFIX_HEADER = "MacPassTests/MacPassTests-Prefix.pch";
|
GCC_PREFIX_HEADER = "MacPassTests/MacPassTests-Prefix.pch";
|
||||||
@@ -2034,6 +2037,7 @@
|
|||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(DEVELOPER_FRAMEWORKS_DIR)",
|
"$(DEVELOPER_FRAMEWORKS_DIR)",
|
||||||
|
"$(PROJECT_DIR)/Carthage/Build/Mac",
|
||||||
);
|
);
|
||||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||||
GCC_PREFIX_HEADER = "MacPassTests/MacPassTests-Prefix.pch";
|
GCC_PREFIX_HEADER = "MacPassTests/MacPassTests-Prefix.pch";
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
#import "MPAutotypeCommand.h"
|
#import "MPAutotypeCommand.h"
|
||||||
|
|
||||||
@interface MPAutotypeDelay : MPAutotypeCommand
|
@interface MPAutotypeDelay : MPAutotypeCommand
|
||||||
|
|
||||||
|
@property (readonly) NSUInteger delay;
|
||||||
/**
|
/**
|
||||||
* Creates an DelayCommand that delays the execution for n milliseconds
|
* Creates an DelayCommand that delays the execution for n milliseconds
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -8,10 +8,8 @@
|
|||||||
|
|
||||||
#import "MPAutotypeDelay.h"
|
#import "MPAutotypeDelay.h"
|
||||||
|
|
||||||
@interface MPAutotypeDelay () {
|
@interface MPAutotypeDelay ()
|
||||||
@private
|
@property (readwrite) NSUInteger delay;
|
||||||
NSUInteger _delay;
|
|
||||||
}
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation MPAutotypeDelay
|
@implementation MPAutotypeDelay
|
||||||
@@ -22,7 +20,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)description {
|
- (NSString *)description {
|
||||||
return [[NSString alloc] initWithFormat:@"%@ delay: %ld ms", self.class, _delay];
|
return [[NSString alloc] initWithFormat:@"%@ delay: %ld ms", self.class, self.delay];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithDelay:(NSUInteger)delay {
|
- (instancetype)initWithDelay:(NSUInteger)delay {
|
||||||
@@ -36,7 +34,7 @@
|
|||||||
|
|
||||||
- (void)execute {
|
- (void)execute {
|
||||||
/* milliseconds * 10000 = microseconds */
|
/* milliseconds * 10000 = microseconds */
|
||||||
usleep((useconds_t)(_delay*1000));
|
usleep((useconds_t)(self.delay*1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
#import "KeePassKit/KeePassKit.h"
|
#import <KeePassKit/KeePassKit.h>
|
||||||
#import "MPEntrySearchContext.h"
|
#import "MPEntrySearchContext.h"
|
||||||
#import "MPTargetNodeResolving.h"
|
#import "MPTargetNodeResolving.h"
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import <XCTest/XCTest.h>
|
#import <XCTest/XCTest.h>
|
||||||
|
#import <KeePassKit/KeePassKit.h>
|
||||||
|
|
||||||
#import "MPDocument.h"
|
#import "MPDocument.h"
|
||||||
#import "KeePassKit/KeePassKit.h"
|
|
||||||
|
|
||||||
@interface MPDatabaseLoading : XCTestCase
|
@interface MPDatabaseLoading : XCTestCase
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,7 @@
|
|||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
#import <XCTest/XCTest.h>
|
#import <XCTest/XCTest.h>
|
||||||
|
#import <KeePassKit/KeePassKit.h>
|
||||||
#import "KeePassKit/KeePassKit.h"
|
|
||||||
|
|
||||||
@interface MPDatabaseSearch : XCTestCase
|
@interface MPDatabaseSearch : XCTestCase
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
#import <Carbon/Carbon.h>
|
#import <Carbon/Carbon.h>
|
||||||
#import <XCTest/XCTest.h>
|
#import <XCTest/XCTest.h>
|
||||||
|
#import <KeePassKit/KeePassKit.h>
|
||||||
|
|
||||||
#import "MPAutotypeCommand.h"
|
#import "MPAutotypeCommand.h"
|
||||||
#import "MPAutotypeContext.h"
|
#import "MPAutotypeContext.h"
|
||||||
@@ -17,7 +18,6 @@
|
|||||||
|
|
||||||
#import "MPKeyMapper.h"
|
#import "MPKeyMapper.h"
|
||||||
|
|
||||||
#import "KeePassKit/KeePassKit.h"
|
|
||||||
|
|
||||||
@interface MPTestAutotype : XCTestCase
|
@interface MPTestAutotype : XCTestCase
|
||||||
@property (strong) KPKEntry *entry;
|
@property (strong) KPKEntry *entry;
|
||||||
|
|||||||
@@ -7,33 +7,64 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import <XCTest/XCTest.h>
|
#import <XCTest/XCTest.h>
|
||||||
|
#import <KeePassKit/KeePassKit.h>
|
||||||
|
|
||||||
|
#import "MPAutotypeContext.h"
|
||||||
|
#import "MPAutotypeDelay.h"
|
||||||
|
|
||||||
@interface MPTestAutotypeDelay : XCTestCase
|
@interface MPTestAutotypeDelay : XCTestCase
|
||||||
|
@property (strong) KPKEntry *entry;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation MPTestAutotypeDelay
|
@implementation MPTestAutotypeDelay
|
||||||
|
|
||||||
- (void)setUp {
|
- (void)setUp {
|
||||||
[super setUp];
|
[super setUp];
|
||||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
self.entry = [[KPKEntry alloc] init];
|
||||||
|
self.entry.title = @"Title";
|
||||||
|
self.entry.url = @"www.myurl.com";
|
||||||
|
self.entry.username = @"Username";
|
||||||
|
self.entry.password = @"Password";
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)tearDown {
|
- (void)tearDown {
|
||||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
[super tearDown];
|
||||||
[super tearDown];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testExample {
|
- (void)testValidDelayCommands {
|
||||||
// This is an example of a functional test case.
|
/* Command 1 */
|
||||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
MPAutotypeContext *context = [[MPAutotypeContext alloc] initWithEntry:self.entry andSequence:@"{DELAY 200}"];
|
||||||
|
NSArray *commands = [MPAutotypeCommand commandsForContext:context];
|
||||||
|
|
||||||
|
XCTAssertTrue(commands.count == 1);
|
||||||
|
/* {DELAY 200} */
|
||||||
|
XCTAssertTrue([commands.firstObject isKindOfClass:[MPAutotypeDelay class]], @"Command is Delay command");
|
||||||
|
MPAutotypeDelay *delay = commands.firstObject;
|
||||||
|
XCTAssertEqual(delay.delay, 200, @"Delay is 200 ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testPerformanceExample {
|
- (void)testDelayExecution {
|
||||||
// This is an example of a performance test case.
|
MPAutotypeDelay *delay = [[MPAutotypeDelay alloc] initWithDelay:200];
|
||||||
[self measureBlock:^{
|
XCTestExpectation *expectation = [self expectationWithDescription:delay.description];
|
||||||
// Put the code you want to measure the time of here.
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||||
}];
|
[delay execute];
|
||||||
|
[expectation fulfill];
|
||||||
|
});
|
||||||
|
|
||||||
|
[self waitForExpectationsWithTimeout:(delay.delay/1000.0) handler:^(NSError *error) {
|
||||||
|
if (error != nil) {
|
||||||
|
NSLog(@"Error: %@", error.localizedDescription);
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- (void)testDelayLimit {
|
||||||
|
XCTFail(@"Missing Test");
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)testMalformedDelay {
|
||||||
|
XCTFail(@"Missing Test");
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -7,9 +7,10 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import <XCTest/XCTest.h>
|
#import <XCTest/XCTest.h>
|
||||||
|
#import <KeePassKit/KeePassKit.h>
|
||||||
|
|
||||||
#import "MPDocument.h"
|
#import "MPDocument.h"
|
||||||
#import "KeePassKit/KeePassKit.h"
|
|
||||||
@interface MPTestDocument : XCTestCase
|
@interface MPTestDocument : XCTestCase
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
Reference in New Issue
Block a user