mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 02:22:28 +00:00
Using current KeePassKit API, added test cast stub for search
This commit is contained in:
48
MacPassTests/KPKTestEntryLookup.m
Normal file
48
MacPassTests/KPKTestEntryLookup.m
Normal 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
|
||||
Reference in New Issue
Block a user