Skip to content

Commit

Permalink
test: Add tests for Line.dot method (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhwood authored Dec 26, 2021
1 parent f6591f3 commit 0c4c003
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
9 changes: 9 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
"version": "1.18.0"
}
},
{
"package": "ViewInspector",
"repositoryURL": "https://github.com/nalexn/ViewInspector",
"state": {
"branch": null,
"revision": "0d546878902bdde8c4682141f848a9dc44e04ba6",
"version": "0.9.0"
}
},
{
"package": "WMATA",
"repositoryURL": "https://github.com/emma-k-alexandra/WMATA.swift",
Expand Down
5 changes: 3 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ let package = Package(
targets: ["WMATAUI"])
],
dependencies: [
.package(name: "WMATA", url: "https://github.com/emma-k-alexandra/WMATA.swift", from: "10.0.0")
.package(name: "WMATA", url: "https://github.com/emma-k-alexandra/WMATA.swift", from: "10.0.0"),
.package(name: "ViewInspector", url: "https://github.com/nalexn/ViewInspector", from: "0.9.0")
],
targets: [
.target(
name: "WMATAUI",
dependencies: ["WMATA"]),
.testTarget(
name: "WMATAUITests",
dependencies: ["WMATAUI"])
dependencies: ["WMATAUI", "ViewInspector"])
]
)
7 changes: 7 additions & 0 deletions Tests/WMATAUITests/LinesUITests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import XCTest
import SwiftUI
import WMATA
import ViewInspector
@testable import WMATAUI

final class LinesUITests: XCTestCase {
Expand All @@ -25,6 +26,12 @@ final class LinesUITests: XCTestCase {
XCTAssertEqual(Line.SV.textColor, .black)
}

func testDot() {
let dot = Line.RD.dot(style: .headline, factor: 1.0)
XCTAssertEqual(try dot.inspect().shape(0).foregroundColor(), MetroRailColor.red)
XCTAssertEqual(try dot.inspect().fixedWidth(), UIFont.preferredFont(forTextStyle: .headline).pointSize)
}

static var allTests = [
("testColor", testColor),
("testTextColor", testTextColor)
Expand Down

0 comments on commit 0c4c003

Please sign in to comment.