Sha256: b707ba7679371d26c86bdbdb663d1d8cecc59ed2259cbe0a540ad440b508889f

Contents?: true

Size: 1.11 KB

Versions: 325

Compression:

Stored size: 1.11 KB

Contents

import XCTest
@testable import HelloWorld

class HelloWorldTests: XCTestCase {

    func testNoName() {
        let expected = "Hello, World!"
        XCTAssertEqual(HelloWorld.hello(), expected, "When given no name, we should greet the world!")
    }

    func testSampleName() {
        let expected = "Hello, Alice!"
        XCTAssertEqual(HelloWorld.hello("Alice"), expected, "When given 'Alice' we should greet Alice!")
    }

    func testOtherSampleName() {
        let expected = "Hello, Bob!"
        XCTAssertEqual(HelloWorld.hello("Bob"), expected, "When given 'Bob' we should greet Bob!")
    }

    func testNoStrangeName() {
        let expected = "Hello, !"
        XCTAssertEqual(HelloWorld.hello(""), expected, "When given an empty string, it is strange, but should have a space and punctuation")
    }

    static var allTests: [(String, (HelloWorldTests) -> () throws -> Void)] {
        return [
            ("testNoName", testNoName),
            ("testSampleName", testSampleName),
            ("testOtherSampleName", testOtherSampleName),
            ("testNoStrangeName", testNoStrangeName),
        ]
    }
}

Version data entries

325 entries across 325 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.179 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.178 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.177 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.176 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.175 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.174 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.173 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.172 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.171 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.170 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.169 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.167 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.166 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.165 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.164 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.163 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.162 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.161 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift
trackler-2.2.1.160 tracks/swift/exercises/hello-world/Tests/HelloWorldTests/HelloWorldTests.swift