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.139 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.138 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.137 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.136 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.135 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.134 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.133 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.132 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.131 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.130 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.129 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.128 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.127 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.126 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.125 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.124 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.123 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.122 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.121 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.120 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift