Fixed Tests

Fixed error that lead to trying to create and array with nil object
This commit is contained in:
michael starke
2013-07-13 00:00:51 +02:00
parent 860d6bb21c
commit a31e287ec8
12 changed files with 182 additions and 39 deletions

View File

@@ -25,22 +25,22 @@
- (void)testSetPassword {
STAssertTrue([_databaseV3.password length] == 0, @"Password should not be set");
STAssertNil(_databaseV3.key, @"Keyfile should not be set");
STAssertFalse(_databaseV3.isSecured, @"Database without password is not secure");
STAssertFalse(_databaseV3.hasPasswordOrKey, @"Database without password is not secure");
_databaseV3.password = @"test";
STAssertTrue([_databaseV3.password isEqualToString:@"test"], @"Password should be set");
STAssertTrue(_databaseV3.isSecured, @"Database with password is secured");
STAssertTrue(_databaseV3.hasPasswordOrKey, @"Database with password is secured");
_databaseV3.password = nil;
STAssertFalse(_databaseV3.isSecured, @"Database with removed password is not secure anymore");
STAssertFalse(_databaseV3.hasPasswordOrKey, @"Database with removed password is not secure anymore");
}
- (void)testSetKeyfile {
STAssertTrue([_databaseV3.password length] == 0, @"Password should not be set");
STAssertNil(_databaseV3.key, @"Keyfile should not be set");
STAssertFalse(_databaseV3.isSecured, @"Database without keyfile is not secure");
STAssertFalse(_databaseV3.hasPasswordOrKey, @"Database without keyfile is not secure");
_databaseV3.key = [NSURL URLWithString:@"noKeyFile"];
STAssertTrue(_databaseV3.isSecured, @"Database with keyfile is secured");
STAssertTrue(_databaseV3.hasPasswordOrKey, @"Database with keyfile is secured");
_databaseV3.key = nil;
STAssertFalse(_databaseV3.isSecured, @"Database with removed keyfile is not secure anymore");
STAssertFalse(_databaseV3.hasPasswordOrKey, @"Database with removed keyfile is not secure anymore");
}