Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 40 lines (31 sloc) 1.049 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
//
// 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 : SenTestCase

@end

@implementation KWDeviceInfoTest

- (void)testItShouldDetectWhenRunningOnSimulator {
#if TARGET_IPHONE_SIMULATOR
    BOOL isSimulator = [KWDeviceInfo isSimulator];
    STAssertTrue(isSimulator, @"expected simulator device to be positive");
#else
    BOOL isSimulator = [KWDeviceInfo isSimulator];
    STAssertFalse(isSimulator, @"expected simulator device to be negative");
#endif // #if TARGET_IPHONE_SIMULATOR
}

- (void)testItShouldDetectWhenRunningOnDevice {
#if TARGET_IPHONE_SIMULATOR
    BOOL isPhysical = [KWDeviceInfo isPhysical];
    STAssertFalse(isPhysical, @"expected physical device to be negative");
#else
    BOOL isPhysical = [KWDeviceInfo isPhysical];
    STAssertTrue(isPhysical, @"expected physical device to be positive");
#endif // #if TARGET_IPHONE_SIMULATOR
}

@end

#endif // #if KW_TESTS_ENABLED
Something went wrong with that request. Please try again.