Files
Kiwi/Tests/KWDeviceInfoTest.m
2014-06-22 21:54:53 +10:00

41 lines
1.0 KiB
Objective-C

//
// Licensed under the terms in License.txt
//
// Copyright 2010 Allen Ding. All rights reserved.
//
#import "Kiwi.h"
#import "KiwiTestConfiguration.h"
#if KW_TESTS_ENABLED
@interface KWDeviceInfoTest : XCTestCase
@end
@implementation KWDeviceInfoTest
- (void)testItShouldDetectWhenRunningOnSimulator {
#if TARGET_IPHONE_SIMULATOR
BOOL isSimulator = [KWDeviceInfo isSimulator];
XCTAssertTrue(isSimulator, @"expected simulator device to be positive");
#else
BOOL isSimulator = [KWDeviceInfo isSimulator];
XCTAssertFalse(isSimulator, @"expected simulator device to be negative");
#endif // #if TARGET_IPHONE_SIMULATOR
}
- (void)testItShouldDetectWhenRunningOnDevice {
#if TARGET_IPHONE_SIMULATOR
BOOL isPhysical = [KWDeviceInfo isPhysical];
XCTAssertFalse(isPhysical, @"expected physical device to be negative");
#else
BOOL isPhysical = [KWDeviceInfo isPhysical];
XCTAssertTrue(isPhysical, @"expected physical device to be positive");
#endif // #if TARGET_IPHONE_SIMULATOR
}
@end
#endif // #if KW_TESTS_ENABLED