-
Notifications
You must be signed in to change notification settings - Fork 0
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
87e9876
commit 8fbce93
Showing
5 changed files
with
60 additions
and
2 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
46 changes: 46 additions & 0 deletions
46
Projects/DesignSystem/DesignCore/UnitTest/DesignCoreTest.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,46 @@ | ||
// | ||
// DesignCoreTest.swift | ||
// DesignCore-UnitTest | ||
// | ||
// Created by 김지수 on 9/14/24. | ||
// Copyright © 2024 com.studentcenter. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
@testable import DesignCore | ||
|
||
final class DesignCoreTest: XCTestCase { | ||
|
||
override func setUpWithError() throws { | ||
// Put setup code here. This method is called before the invocation of each test method in the class. | ||
} | ||
|
||
override func tearDownWithError() throws { | ||
// Put teardown code here. This method is called after the invocation of each test method in the class. | ||
} | ||
|
||
func testFontImport() { | ||
let pretendard = UIFont.pretendard(._600, size: 20) | ||
XCTAssertEqual(pretendard.familyName, "Pretendard") | ||
let robotoSlab = UIFont.robotoSlab(size: 20) | ||
XCTAssertEqual(robotoSlab.familyName, "Roboto Slab") | ||
} | ||
|
||
func testTypography() { | ||
/// en-typo 는 pretendardWeight 를 가져선 안됨 | ||
let enTypo = [Typography.en_medium_16, Typography.en_medium_20] | ||
let enPretendardWeight = enTypo | ||
.compactMap { $0.pretendardWeight } | ||
XCTAssertEqual(enPretendardWeight, []) | ||
|
||
/// pretendard typo 는 pretendardWeight 를 항상 가지고 있어야 함 | ||
let pretendardTypos = Typography.allCases | ||
.filter { typo in | ||
!enTypo.contains { $0 == typo } | ||
} | ||
.compactMap { $0.pretendardWeight } | ||
|
||
let pretendardCount = Typography.allCases.count - enTypo.count | ||
XCTAssertEqual(pretendardTypos.count, pretendardCount) | ||
} | ||
} |
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