Sha256: 6d16f4e27bd46a2ab050fb32bd491b86e0f831ec3ba57e2fdea881d85ee43f7d

Contents?: true

Size: 1.24 KB

Versions: 396

Compression:

Stored size: 1.24 KB

Contents

#import <XCTest/XCTest.h>

#if __has_include("ScrabbleScoreExample.h")
# import "ScrabbleScoreExample.h"
# else
# import "ScrabbleScore.h"
#endif

@interface ScrabbleScoreTest : XCTestCase

@end

@implementation ScrabbleScoreTest

- (void)testEmptyWordScoresZero {
    XCTAssertEqual(0, [[[ScrabbleScore alloc] initWithWord:@""] score]);
}

- (void)testWhitespaceScoresZero {
    XCTAssertEqual(0, [[[ScrabbleScore alloc] initWithWord:@" \t\n"] score]);
}

- (void)testNilScoresZero {
    XCTAssertEqual(0, [[[ScrabbleScore alloc] initWithWord:nil] score]);
}

- (void)testScoresVeryShortWord {
    XCTAssertEqual(1, [[[ScrabbleScore alloc] initWithWord:@"a"] score]);
}

- (void)testScoresOtherVeryShortWord {
    XCTAssertEqual(4, [[[ScrabbleScore alloc] initWithWord:@"f"] score]);
}

- (void)testSimpleWordScoresTheNumberOfLetters {
    XCTAssertEqual(6, [[[ScrabbleScore alloc] initWithWord:@"street"] score]);
}

- (void)testComplicatedWordScoresMore {
    XCTAssertEqual(22, [[[ScrabbleScore alloc] initWithWord:@"quirky"] score]);
}

- (void)testScoresAreCaseInsensitive {
    XCTAssertEqual(41, [[[ScrabbleScore alloc] initWithWord:@"OXYPHENBUTAZONE"] score]);
}

- (void)testConvenientScoring {
    XCTAssertEqual(13, [ScrabbleScore score:@"alacrity"]);
}

@end

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.98 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.97 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.96 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.95 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.94 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.93 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.92 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.91 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.90 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.89 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.88 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.87 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.86 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.85 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.84 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.83 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.82 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.81 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.80 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m
trackler-2.2.1.79 tracks/objective-c/exercises/scrabble-score/ScrabbleScoreTest.m