From ee1533db6d999938109fa10ad769c654c36f53c1 Mon Sep 17 00:00:00 2001 From: Felix Schulze Date: Mon, 15 Jun 2015 17:37:03 +0200 Subject: [PATCH] Add some tests --- OpenSSL-for-iOS_Tests/FSOpenSSLTests.m | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/OpenSSL-for-iOS_Tests/FSOpenSSLTests.m b/OpenSSL-for-iOS_Tests/FSOpenSSLTests.m index 2782fdf..a94148d 100644 --- a/OpenSSL-for-iOS_Tests/FSOpenSSLTests.m +++ b/OpenSSL-for-iOS_Tests/FSOpenSSLTests.m @@ -30,4 +30,21 @@ XCTAssertEqualObjects([FSOpenSSL md5FromString:@"test string"], @"6f8db599de986fab7a21625b7916589c"); } +- (void)testSHA256 +{ + XCTAssertEqualObjects([FSOpenSSL sha256FromString:@"test string"], @"d5579c46dfcc7f18207013e65b44e4cb4e2c2298f4ac457ba8f82743f31e930b"); +} + +- (void)testBase64 +{ + XCTAssertEqualObjects([FSOpenSSL base64FromString:@"test string" encodeWithNewlines:NO], @"dGVzdCBzdHJpbmc="); +} + +- (void)testBase64WithNewLines +{ + XCTAssertEqualObjects([FSOpenSSL base64FromString:@"test string" encodeWithNewlines:YES], @"dGVzdCBzdHJpbmc=\n"); +} + + + @end