-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1738e1
commit 8f7a7d3
Showing
5 changed files
with
96 additions
and
9 deletions.
There are no files selected for viewing
14 changes: 9 additions & 5 deletions
14
Sources/RugbyFoundation/Core/Common/Hashers/ProductHasher.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
Tests/FoundationTests/Core/Common/Hashers/ProductHasherTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
@testable import RugbyFoundation | ||
import XCTest | ||
|
||
final class ProductHasherTests: XCTestCase { | ||
private var sut: IProductHasher! | ||
|
||
override func setUp() { | ||
super.setUp() | ||
sut = ProductHasher() | ||
} | ||
|
||
override func tearDown() { | ||
super.tearDown() | ||
sut = nil | ||
} | ||
} | ||
|
||
extension ProductHasherTests { | ||
func test_framework() { | ||
let product = Product( | ||
name: "KeyboardLayoutGuide", | ||
moduleName: "KeyboardLayoutGuide", | ||
type: .framework, | ||
parentFolderName: "Keyboard+LayoutGuide-framework" | ||
) | ||
|
||
// Act | ||
let hashContext = sut.hashContext(product) | ||
|
||
// Assert | ||
XCTAssertEqual( | ||
hashContext, | ||
[ | ||
"parentFolderName": "Keyboard+LayoutGuide-framework", | ||
"name": "KeyboardLayoutGuide", | ||
"type": "com.apple.product-type.framework" | ||
] | ||
) | ||
} | ||
|
||
func test_library() { | ||
let product = Product( | ||
name: "Keyboard+LayoutGuide-library", | ||
moduleName: "KeyboardLayoutGuide", | ||
type: .staticLibrary, | ||
parentFolderName: "Keyboard+LayoutGuide-library" | ||
) | ||
|
||
// Act | ||
let hashContext = sut.hashContext(product) | ||
|
||
// Assert | ||
XCTAssertEqual( | ||
hashContext, | ||
[ | ||
"parentFolderName": "Keyboard+LayoutGuide-library", | ||
"name": "Keyboard+LayoutGuide-library", | ||
"type": "com.apple.product-type.library.static" | ||
] | ||
) | ||
} | ||
|
||
func test_bundle() { | ||
let product = Product( | ||
name: "LocalPodResources", | ||
moduleName: nil, | ||
type: .bundle, | ||
parentFolderName: "LocalPod-framework" | ||
) | ||
|
||
// Act | ||
let hashContext = sut.hashContext(product) | ||
|
||
// Assert | ||
XCTAssertEqual( | ||
hashContext, | ||
[ | ||
"parentFolderName": "LocalPod-framework", | ||
"name": "LocalPodResources", | ||
"type": "com.apple.product-type.bundle" | ||
] | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
@testable import Rugby | ||
import RugbyFoundation | ||
import XCTest | ||
|
||
final class RegexTests: XCTestCase { | ||
|