Sha256: a871e2b0b1f6a2c719eb50b202baa23d72bd61b850307c599646e9bad7fa31ee

Contents?: true

Size: 1.68 KB

Versions: 188

Compression:

Stored size: 1.68 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 testScoringUtility() {
        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),
            ("testScoringUtility", testScoringUtility),
        ]
    }
}

Version data entries

188 entries across 188 versions & 1 rubygems

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