Files
Anton Tingström dc7f90cdc4 Universal framework for macOS, iOS, and tvOS.
The framework supports loading images and, on iOS/tvOS, styling the flags in a few different shapes. It has unit tests for all platforms, verifying the framework can load images from the bundle and compares the generated styled flags with test fixtures.
2017-08-09 09:13:23 +02:00

37 lines
724 B
Objective-C

//
// Copyright © 2017 Bowtie. All rights reserved.
//
@import XCTest;
@import FlagKit;
@interface ObjectiveCTests : XCTestCase
@end
@implementation ObjectiveCTests
- (void)testValidCountryCode {
FKFlag *flag = [[FKFlag alloc] initWithCountryCode:@"SE"];
XCTAssertNotNil(flag);
XCTAssertEqual(flag.countryCode, @"SE");
XCTAssertNotNil(flag.originalImage);
}
- (void)testInvalidCountryCode {
FKFlag *flag = [[FKFlag alloc] initWithCountryCode:@"FLAGKIT"];
XCTAssertNil(flag);
}
#if TARGET_OS_IPHONE
- (void)testStyleImage {
FKFlag *flag = [[FKFlag alloc] initWithCountryCode:@"SE"];
UIImage *image = [flag imageWithStyle:FKFlagStyleNone];
XCTAssertNotNil(image);
}
#endif
@end