Add som units tests (split some code to made some part testable)
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
This commit is contained in:
35
Tests/ResgenSwiftTests/Fonts/FontPlistGeneratorTests.swift
Normal file
35
Tests/ResgenSwiftTests/Fonts/FontPlistGeneratorTests.swift
Normal file
@ -0,0 +1,35 @@
|
||||
//
|
||||
// FontPlistGeneratorTests.swift
|
||||
//
|
||||
//
|
||||
// Created by Thibaut Schmitt on 05/09/2022.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import XCTest
|
||||
|
||||
@testable import ResgenSwift
|
||||
|
||||
final class FontPlistGeneratorTests: XCTestCase {
|
||||
func testGeneratedPlist() {
|
||||
// Given
|
||||
let fontNames: [FontName] = [
|
||||
"CircularStd-Regular",
|
||||
"CircularStd-Bold"
|
||||
]
|
||||
|
||||
// When
|
||||
let plistContent = FontPlistGenerator.generatePlistUIAppsFontContent(for: fontNames)
|
||||
|
||||
// Expect
|
||||
let expect = """
|
||||
<key>UIAppFonts</key>
|
||||
<array>
|
||||
<string>CircularStd-Regular</string>
|
||||
<string>CircularStd-Bold</string>
|
||||
</array>
|
||||
"""
|
||||
|
||||
XCTAssertEqual(plistContent.adaptForXCTest(), expect.adaptForXCTest())
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user