Skip to content

Commit

Permalink
AMP-36170 add more unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
qingzhuozhen committed Feb 7, 2024
1 parent 9b20ade commit 06b5eaf
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions Tests/AMPUtilsTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@ @interface AMPUtilTests : XCTestCase

@end

@implementation AMPUtilTests {

@interface FakeAMPUtils: AMPUtils
@end

@implementation FakeAMPUtils

+ (NSDictionary *)getEnvironment {
return @{@"APP_SANDBOX_CONTAINER_ID": @"test-container-id"};
}

@end

@implementation AMPUtilTests {}

- (void) testIsSandboxEnabled {
BOOL isSandboxEnabled = [AMPUtils isSandboxEnabled];
#if TARGET_OS_OSX
Expand All @@ -26,4 +35,11 @@ - (void) testIsSandboxEnabled {
#endif
}

#if TARGET_OS_OSX
- (void) testIsSandboxEnabledWhenMacOSIsSandboxed {
BOOL isSandboxEnabled = [FakeAMPUtils isSandboxEnabled];
XCTAssertEqual(isSandboxEnabled, YES);
}
#endif

@end

0 comments on commit 06b5eaf

Please sign in to comment.