Sha256: 9169d95ba9612ed629a7d30deb0d062f6fa2930ef0a92bcd9c60b93cb589acfc
Contents?: true
Size: 1.69 KB
Versions: 137
Compression:
Stored size: 1.69 KB
Contents
import XCTest @testable import ScrabbleScore class ScrabbleScoreTests: XCTestCase { func testEmptyWordScoresZero() { XCTAssertEqual( 0, Scrabble("").score) } func testWhitespaceScoresZero() { XCTAssertEqual( 0, Scrabble(" \t\n").score) } func testNilScoresZero() { XCTAssertEqual( 0, Scrabble(nil).score) } func testScoresVeryShortWord() { XCTAssertEqual( 1, Scrabble("a").score) } func testScoresOtherVeryShortWord() { XCTAssertEqual( 4, Scrabble("f").score) } func testSimpleWordScoresTheNumberOfLetters() { XCTAssertEqual( 6, Scrabble("street").score) } func testComplicatedWordScoresMore() { XCTAssertEqual( 22, Scrabble("quirky").score) } func testScoresAreCaseInsensitive() { XCTAssertEqual( 41, Scrabble("OXYPHENBUTAZONE").score) } func testConvenientScoring() { XCTAssertEqual( 13, Scrabble.score("alacrity")) } static var allTests: [(String, (ScrabbleScoreTests) -> () throws -> Void)] { return [ ("testEmptyWordScoresZero", testEmptyWordScoresZero), ("testWhitespaceScoresZero", testWhitespaceScoresZero), ("testNilScoresZero", testNilScoresZero), ("testScoresVeryShortWord", testScoresVeryShortWord), ("testScoresOtherVeryShortWord", testScoresOtherVeryShortWord), ("testSimpleWordScoresTheNumberOfLetters", testSimpleWordScoresTheNumberOfLetters), ("testComplicatedWordScoresMore", testComplicatedWordScoresMore), ("testScoresAreCaseInsensitive", testScoresAreCaseInsensitive), ("testConvenientScoring", testConvenientScoring), ] } }
Version data entries
137 entries across 137 versions & 1 rubygems