diff --git a/ObjectiveCExample/ObjectiveCExampleTests/SSZipArchiveTests.m b/ObjectiveCExample/ObjectiveCExampleTests/SSZipArchiveTests.m index 9b6b826..294099d 100644 --- a/ObjectiveCExample/ObjectiveCExampleTests/SSZipArchiveTests.m +++ b/ObjectiveCExample/ObjectiveCExampleTests/SSZipArchiveTests.m @@ -173,7 +173,22 @@ XCTAssertTrue([fileManager fileExistsAtPath:testPath], @"LICENSE unzipped"); } -- (void)testPasswordCheck { +- (void)testValidatePassword { + NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestPasswordArchive" ofType:@"zip"]; + + NSError *error = nil; + + BOOL fileHasValidPassword = [SSZipArchive isPasswordValidForArchiveAtPath:zipPath password:@"passw0rd" error:&error]; + + XCTAssertTrue(fileHasValidPassword,@"Valid password reports true."); + + BOOL fileHasInvalidValidPassword = [SSZipArchive isPasswordValidForArchiveAtPath:zipPath password:@"passw0rd123" error:&error]; + + XCTAssertFalse(fileHasInvalidValidPassword,@"Invalid password reports false."); + +} + +- (void)testFilePasswordCheck { NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"TestArchive" ofType:@"zip"]; BOOL protected = [SSZipArchive isFilePasswordProtectedAtPath:zipPath]; diff --git a/ObjectiveCExample/Podfile.lock b/ObjectiveCExample/Podfile.lock index c7449c8..f7483f8 100644 --- a/ObjectiveCExample/Podfile.lock +++ b/ObjectiveCExample/Podfile.lock @@ -13,4 +13,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: ae5fb993e5dc339b15e10067d1e60549fa585f32 -COCOAPODS: 1.1.0.rc.2 +COCOAPODS: 1.1.1