Sha256: 18b4f1792a0fadf101bbc557fb4e4cd78cee11c24861c192617b9294c5399de3

Contents?: true

Size: 1.2 KB

Versions: 348

Compression:

Stored size: 1.2 KB

Contents

#import <XCTest/XCTest.h>

#if __has_include("AtbashCipherExample.h")
# import "AtbashCipherExample.h"
# else
# import "AtbashCipher.h"
#endif

@interface AtbashCipherTest : XCTestCase

@end

@implementation AtbashCipherTest

- (void)testEncodeNo {
    XCTAssertEqualObjects(@"ml", [AtbashCipher encode:@"no"]);
}

- (void)testEncodeYes {
    XCTAssertEqualObjects(@"bvh", [AtbashCipher encode:@"yes"]);
}

- (void)testEncodeOMG {
    XCTAssertEqualObjects(@"lnt", [AtbashCipher encode:@"OMG"]);
}

- (void)testEncodeOMGWithSpaces {
    XCTAssertEqualObjects(@"lnt", [AtbashCipher encode:@"O M G"]);
}

- (void)testEncodeLongWord {
    XCTAssertEqualObjects(@"nrmwy oldrm tob", [AtbashCipher encode:@"mindblowingly"]);
}

- (void)testEncodeNumbers {
    XCTAssertEqualObjects(@"gvhgr mt123 gvhgr mt", [AtbashCipher encode:@"Testing, 1 2 3, testing."]);
}

- (void)testEncodeSentence {
    XCTAssertEqualObjects(@"gifgs rhurx grlm", [AtbashCipher encode:@"Truth is fiction."]);
}

- (void)testEncodeAllTheThings {
    NSString *plaintext = @"The quick brown fox jumps over the lazy dog.";
    NSString *cipher = @"gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt";
    XCTAssertEqualObjects(cipher, [AtbashCipher encode:plaintext]);
}

@end

Version data entries

348 entries across 348 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.179 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.178 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.177 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.176 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.175 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.174 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.173 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.172 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.171 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.170 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.169 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.167 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.166 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.165 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.164 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.163 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.162 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.161 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m
trackler-2.2.1.160 tracks/objective-c/exercises/atbash-cipher/AtbashCipherTest.m