Skip to content

Commit

Permalink
タプルに別名を付け、可読性を上げた
Browse files Browse the repository at this point in the history
  • Loading branch information
uhooi committed Nov 30, 2019
1 parent 0fb0da8 commit c19b402
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions PrameterizedTestSampleTests/LogicSampleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,15 @@ class LogicSampleTests: XCTestCase {
// パラメタライズドテスト

func test_canWork() {
let tests: [(line: UInt, motivation: Int, hasRedBull: Bool, expect: Bool)] = [
typealias TestCase = (line: UInt, motivation: Int, hasRedBull: Bool, expect: Bool)
let testCases: [TestCase] = [
(#line, 99, true, false),
(#line, 99, false, false),
(#line, 100, true, true),
(#line, 100, true, true ),
(#line, 100, false, false)
]

for (line, motivation, hasRedBull, expect) in tests {
for (line, motivation, hasRedBull, expect) in testCases {
let logic = LogicSample()
let result = logic.canWork(motivation: motivation, hasRedBull: hasRedBull)
XCTAssertEqual(result, expect, line: line)
Expand Down

0 comments on commit c19b402

Please sign in to comment.