Sha256: 1db213c844f5824ef01aaa2afcb8a98917a013e43a616b1a286f647f09b5b5de

Contents?: true

Size: 1.67 KB

Versions: 111

Compression:

Stored size: 1.67 KB

Contents

#import <XCTest/XCTest.h>

#if __has_include("SayExample.h")
# import "SayExample.h"
#else
# import "Say.h"
#endif

@interface SayTest : XCTestCase

@end

@implementation SayTest

- (void)testZero {
    XCTAssertEqualObjects(@"zero", [Say say:0]);
}

- (void)testOne {
    XCTAssertEqualObjects(@"one", [Say say:1]);
}

- (void)testFourteen {
    XCTAssertEqualObjects(@"fourteen", [Say say:14]);
}

- (void)testTwenty {
    XCTAssertEqualObjects(@"twenty", [Say say:20]);
}

- (void)testTwentyTwo {
    XCTAssertEqualObjects(@"twenty-two", [Say say:22]);
}

- (void)testOneHundred {
    XCTAssertEqualObjects(@"one hundred", [Say say:100]);
}

- (void)testOneHundredTwentyThree {
    XCTAssertEqualObjects(@"one hundred twenty-three", [Say say:123]);
}

- (void)testOneThousand {
    XCTAssertEqualObjects(@"one thousand", [Say say:1000]);
}

- (void)testOneThousandTwoHundredThirtyFour {
    XCTAssertEqualObjects(@"one thousand two hundred thirty-four", [Say say:1234]);
}

- (void)testOneMillion {
    XCTAssertEqualObjects(@"one million", [Say say:1000000]);
}

- (void)testOneMillionTwoThousandThreeHundredFortyFive {
    XCTAssertEqualObjects(@"one million two thousand three hundred forty-five", [Say say:1002345]);
}

- (void)testOneBillion {
    XCTAssertEqualObjects(@"one billion", [Say say:1000000000]);
}

- (void)testABigNumber {
    XCTAssertEqualObjects(@"nine hundred eighty-seven billion six hundred fifty-four million three hundred twenty-one thousand one hundred twenty-three", [Say say:987654321123]);
}

- (void)testNumbersBelowZeroAreOutOfRange {
    XCTAssertNil([Say say:-1]);
}

- (void)testNumbersAbove999999999999AreOutOfRange {
    XCTAssertNil([Say say:1000000000000]);
}

@end

Version data entries

111 entries across 111 versions & 1 rubygems

Version Path
trackler-2.2.1.119 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.118 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.117 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.116 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.115 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.114 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.113 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.111 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.110 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.109 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.108 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.107 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.106 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.105 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.104 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.103 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.102 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.101 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.100 tracks/objective-c/exercises/say/SayTest.m
trackler-2.2.1.99 tracks/objective-c/exercises/say/SayTest.m