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.119 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.118 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.117 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.116 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.115 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.114 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.113 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.111 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.110 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.109 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.108 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.107 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.106 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.105 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.104 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.103 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.102 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.101 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.100 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift
trackler-2.2.1.99 tracks/swift/exercises/scrabble-score/Tests/ScrabbleScoreTests/ScrabbleScoreTests.swift