Sha256: 95c4b17cbc507a0e7527a209c0cca4cc2e1c1edc217c8da9070e2e33766a3b66

Contents?: true

Size: 918 Bytes

Versions: 396

Compression:

Stored size: 918 Bytes

Contents

#import <XCTest/XCTest.h>

#if __has_include("HelloWorldExample.h")
# import "HelloWorldExample.h"
# else
# import "HelloWorld.h"
#endif

NS_ASSUME_NONNULL_BEGIN

@interface HelloWorldTest : XCTestCase

@end

@implementation HelloWorldTest

- (HelloWorld *)helloWorld {
  return [[HelloWorld alloc] init];
}

- (void)testNoName {
  NSString *input = nil;
  NSString *expected = @"Hello, World!";
  NSString *result = [[self helloWorld] hello:input];
  XCTAssertEqualObjects(expected, result);
}

- (void)testSampleName {
  NSString *input = @"Alice";
  NSString *expected = @"Hello, Alice!";
  NSString *result = [[self helloWorld] hello:input];
  XCTAssertEqualObjects(expected, result);
}
  
- (void)testOtherSampleName {
  NSString *input = @"Bob";
  NSString *expected = @"Hello, Bob!";
  NSString *result = [[self helloWorld] hello:input];
  XCTAssertEqualObjects(expected, result);
}

@end
NS_ASSUME_NONNULL_END

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.159 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.158 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.157 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.156 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.155 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.154 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.153 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.152 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.151 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.150 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.149 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.148 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.147 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.146 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.145 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.144 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.143 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.142 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.141 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.140 tracks/objective-c/exercises/hello-world/HelloWorldTest.m