Skip to content

Commit

Permalink
Added tests for new Data based functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Abt committed Aug 13, 2016
1 parent a10caa8 commit dbe4653
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tests/CryptorTests/CryptorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class CryptorTests: XCTestCase {
("test_Cryptor_DES_EBC_1", test_Cryptor_DES_EBC_1),
("testMD2", testMD2),
("testMD5_1", testMD5_1),
("test_Digest_MD5_NSData", test_Digest_MD5_Data),
("test_Digest_MD5_NSData", test_Digest_MD5_NSData),
("test_Digest_MD5_Composition_String", test_Digest_MD5_Composition_String),
("test_Digest_MD5_Composition_String_2", test_Digest_MD5_Composition_String_2),
Expand Down Expand Up @@ -378,6 +379,13 @@ class CryptorTests: XCTestCase {
XCTAssertEqual(digest!, qbfMD5, "PASS")
}

func test_Digest_MD5_Data() {
var qbfData: Data = CryptoUtils.data(from: self.qbfBytes)
let digest = Digest(using: .md5).update(data: &qbfData)?.final()

XCTAssertEqual(digest!, qbfMD5, "PASS")
}

/// Test MD5 with string input and optional chaining.
func test_Digest_MD5_Composition_String() {
let digest = Digest(using: .md5).update(string: qbfString)?.final()
Expand Down

0 comments on commit dbe4653

Please sign in to comment.