Experiments with globe hot-key via EventTaps instead of Carbon API

Drag and Drop of entries and groups reworked
Minor fixes in Tests
This commit is contained in:
michael starke
2013-08-15 22:45:54 +02:00
parent 16f10942ee
commit 9c69bd6528
10 changed files with 162 additions and 53 deletions

View File

@@ -0,0 +1,34 @@
//
// KPKTextPlaceholder.m
// MacPass
//
// Created by Michael Starke on 15.08.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import "KPKTestPlaceholder.h"
#import "KPKEntry.h"
#import "KPKAttribute.h"
#import "NSString+Placeholder.h"
@implementation KPKTextPlaceholder
- (void)testPlaceholder {
KPKEntry *entry = [[KPKEntry alloc] init];
entry.title = @"TestTitle";
entry.username = @"TestUsername";
entry.notes = @"TestNotes";
entry.url = @"TestURL";
entry.password = @"TestPassword";
KPKAttribute *attribute = [[KPKAttribute alloc] initWithKey:@"extended" value:@"valueForExtended"];
[entry addCustomAttribute:attribute];
NSString *placeholder = @"{USERNAME}{PASSWORD}{NOTHING}{URL}{S:extended}";
BOOL replaced;
NSString *evaluated = [placeholder evaluatePlaceholderWithEntry:entry didReplace:&replaced];
NSString *evaluatedGoal = [NSString stringWithFormat:@"%@%@{NOTHING}%@%@", entry.username, entry.password, entry.url, attribute.value];
STAssertTrue([evaluated isEqualToString:evaluatedGoal], @"Evaluated string must match");
}
@end