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.139 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.138 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.137 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.136 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.135 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.134 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.133 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.132 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.131 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.130 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.129 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.128 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.127 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.126 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.125 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.124 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.123 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.122 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.121 tracks/objective-c/exercises/hello-world/HelloWorldTest.m
trackler-2.2.1.120 tracks/objective-c/exercises/hello-world/HelloWorldTest.m