github.com/psiphon-labs/psiphon-tunnel-core@v2.0.28+incompatible/MobileLibrary/iOS/PsiphonTunnel/PsiphonTunnelTests/PsiphonTunnelTests.m (about) 1 /* 2 * Copyright (c) 2021, Psiphon Inc. 3 * All rights reserved. 4 * 5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 * 18 */ 19 20 #import <XCTest/XCTest.h> 21 22 #import "PsiphonTunnel.h" 23 24 25 @interface PsiphonTunnelDelegate : NSObject <TunneledAppDelegate> 26 @end 27 @implementation PsiphonTunnelDelegate 28 29 - (NSString * _Nullable)getPsiphonConfig { 30 return @""; 31 } 32 33 @end 34 35 36 @interface PsiphonTunnelTests : XCTestCase 37 @property PsiphonTunnelDelegate *psiphonTunnelDelegate; 38 @end 39 40 @implementation PsiphonTunnelTests 41 42 - (void)setUp { 43 [super setUp]; 44 // Put setup code here. This method is called before the invocation of each test method in the class. 45 self.psiphonTunnelDelegate = [[PsiphonTunnelDelegate alloc] init]; 46 } 47 48 - (void)tearDown { 49 // Put teardown code here. This method is called after the invocation of each test method in the class. 50 [super tearDown]; 51 } 52 53 - (void)testExample { 54 // This is an example of a functional test case. 55 // Use XCTAssert and related functions to verify your tests produce the correct results. 56 57 PsiphonTunnel *tunnel = [PsiphonTunnel newPsiphonTunnel:self.psiphonTunnelDelegate]; 58 XCTAssertNotNil(tunnel); 59 } 60 61 - (void)testPerformanceExample { 62 // This is an example of a performance test case. 63 [self measureBlock:^{ 64 // Put the code you want to measure the time of here. 65 }]; 66 } 67 68 @end 69