Sha256: bd054ef01717835035bff987b6022ca322dba604dc33ae194134a46df1b72cdc

Contents?: true

Size: 985 Bytes

Versions: 132

Compression:

Stored size: 985 Bytes

Contents

#import <XCTest/XCTest.h>

#if __has_include("BobExample.h")
# import "NthPrimeExample.h"
#else
# import "NthPrime.h"
#endif

NS_ASSUME_NONNULL_BEGIN

@interface NthPrimeTest : XCTestCase

@end

@implementation NthPrimeTest

- (void)testFirstPrime {
	int primeNum = 1;
	int expected = 2;
	int result = [NthPrime primeNum:primeNum];
	XCTAssertEqual(expected, result);
}

- (void)testSecondPrime {
	int primeNum = 2;
	int expected = 3;
	int result = [NthPrime primeNum:primeNum];
	XCTAssertEqual(expected, result);
}

- (void)testSixthPrime {
	int primeNum = 6;
	int expected = 13;
	int result = [NthPrime primeNum:primeNum];
	XCTAssertEqual(expected, result);
}

- (void)testBigPrime {
	int primeNum = 10001;
	int expected = 104743;
	int result = [NthPrime primeNum:primeNum];
	XCTAssertEqual(expected, result);
}

- (void)testZeroPrime {
	int primeNum = 0;
	int expected = 0;
	int result = [NthPrime primeNum:primeNum];
	XCTAssertEqual(expected, result);
}

@end
NS_ASSUME_NONNULL_END

Version data entries

132 entries across 132 versions & 1 rubygems

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