Using current KeePassKit, extended Tests

Signed-off-by: michael starke <michael.starke@hicknhack-software.com>
This commit is contained in:
michael starke
2015-08-12 18:12:19 +02:00
parent c624bbb364
commit f02788116c
4 changed files with 95 additions and 11 deletions

View File

@@ -336,8 +336,27 @@
XCTFail(@"Missing test");
}
- (void)testUpdateToInvalidNode {
XCTAssertFalse(_undoManager.canUndo, @"Undo stack is empty");
XCTAssertFalse(_undoManager.canRedo, @"Redo stack is empty");
KPKEntry *invalid = [_tree createEntry:_tree.root];
KPKEntry *copy = [_entryA copy];
XCTAssertThrows([_entryA updateToNode:invalid], @"Updating to a wrong node is not allowed");
XCTAssertEqualObjects(_entryA, copy, @"Entry a has no changes after updateToNode was called with wrong node argument");
XCTAssertFalse(_undoManager.canUndo, @"Undo stack is empty after failed update");
XCTAssertFalse(_undoManager.canRedo, @"Redo stack is empty after failed update");
}
- (void)testUndoRedoEditEntry {
XCTFail(@"Missing test");
XCTAssertFalse(_undoManager.canUndo, @"Undo stack is empty");
XCTAssertFalse(_undoManager.canRedo, @"Redo stack is empty");
KPKEntry *copy = [_entryA copy];
copy.title = @"New Title";
copy.url = @"New URL";
}
- (void)testUndoRedoEditGroup {