Using current KeePassKit API, added test cast stub for search

This commit is contained in:
michael starke
2015-07-21 14:27:11 +02:00
parent db61fb7348
commit 0c315eef31
3 changed files with 54 additions and 2 deletions

View File

@@ -0,0 +1,48 @@
//
// KPKTestEntryLookup.m
// MacPass
//
// Created by Michael Starke on 21/07/15.
// Copyright (c) 2015 HicknHack Software GmbH. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import <XCTest/XCTest.h>
#import "KPKTree.h"
#import "KPKGroup.h"
#import "KPKEntry.h"
#import "KPKAutotype.h"
@interface KPKTestEntryLookup : XCTestCase
@property (strong) KPKTree *tree;
@property (weak) KPKEntry *includedInSearch;
@property (weak) KPKEntry *excludedFromSearch;
@end
@implementation KPKTestEntryLookup
- (void)setUp {
[super setUp];
KPKTree *tree = [[KPKTree alloc] init];
KPKGroup *root = [tree createGroup:nil];
tree.root = root;
KPKGroup *searchableGroup = [tree createGroup:tree.root];
KPKGroup *unsearchableGroup = [tree createGroup:tree.root];
[tree.root addGroup:searchableGroup];
[tree.root addGroup:unsearchableGroup];
searchableGroup.isSearchEnabled = KPKInheritYES;
unsearchableGroup.isSearchEnabled = KPKInheritNO;
KPKEntry *entryA = [tree createEntry:searchableGroup];
KPKEntry *entryB = [tree createEntry:unsearchableGroup];
[searchableGroup addEntry:entryA];
[unsearchableGroup addEntry:entryB];
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
@end