Sha256: cd98b34a09c52c593202c5d28a25b510112da8b6e8ba467db3879a41a6e01818
Contents?: true
Size: 865 Bytes
Versions: 78
Compression:
Stored size: 865 Bytes
Contents
#import <XCTest/XCTest.h> #if __has_include("CollatzConjectureExample.h") # import "CollatzConjectureExample.h" # else # import "CollatzConjecture.h" #endif @interface CollatzConjectureTest : XCTestCase @end @implementation CollatzConjectureTest - (void)testZeroStepsForOne { XCTAssertEqual(0, [CollatzConjecture stepsForNumber:1]); } - (void)testDivideIfEven { XCTAssertEqual(4, [CollatzConjecture stepsForNumber:16]); } - (void)testEvenAndOddSteps { XCTAssertEqual(9, [CollatzConjecture stepsForNumber:12]); } - (void)testLargeNumberOfEvenAndOddSteps { XCTAssertEqual(152, [CollatzConjecture stepsForNumber:1000000]); } - (void)testZeroIsAnError { XCTAssertEqual([CollatzConjecture stepsForNumber:0], NSNotFound); } - (void)testNegativeValueIsAnError { XCTAssertEqual([CollatzConjecture stepsForNumber:-15], NSNotFound); } @end
Version data entries
78 entries across 78 versions & 1 rubygems