-
Notifications
You must be signed in to change notification settings - Fork 1
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
df5adf8
commit 4fe2d15
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// ColorExtensionTest.swift | ||
// CalqTests | ||
// | ||
// Created by Kiara on 20.11.24. | ||
// | ||
|
||
import XCTest | ||
@testable import Calq | ||
|
||
final class ColorExtensionTest: XCTestCase { | ||
|
||
func testgetPastelColorByIndex() { | ||
let targetColor = pastelColors.first | ||
XCTAssertEqual(targetColor, getPastelColorByIndex(0)) | ||
} | ||
|
||
func test_toHexString() { | ||
let expected = "#ffffff" | ||
XCTAssertEqual(expected, UIColor.white.toHexString()) | ||
} | ||
} | ||
|
||
final class DoubleExtensionTest: XCTestCase { | ||
|
||
func test_rounded() { | ||
let expected = 2.878 | ||
XCTAssertEqual(2.9, expected.rounded(toPlaces: 1)) | ||
} | ||
|
||
func test_rounded2() { | ||
let expected = -2.794 | ||
XCTAssertEqual(-2.79, expected.rounded(toPlaces: 2)) | ||
} | ||
} |