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