PsiphonTunnelTests.m 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. #import <XCTest/XCTest.h>
  20. #import "PsiphonTunnel.h"
  21. @interface PsiphonTunnelDelegate : NSObject <TunneledAppDelegate>
  22. @end
  23. @implementation PsiphonTunnelDelegate
  24. - (NSString * _Nullable)getPsiphonConfig {
  25. return @"";
  26. }
  27. @end
  28. @interface PsiphonTunnelTests : XCTestCase
  29. @property PsiphonTunnelDelegate *psiphonTunnelDelegate;
  30. @end
  31. @implementation PsiphonTunnelTests
  32. - (void)setUp {
  33. [super setUp];
  34. // Put setup code here. This method is called before the invocation of each test method in the class.
  35. self.psiphonTunnelDelegate = [[PsiphonTunnelDelegate alloc] init];
  36. }
  37. - (void)tearDown {
  38. // Put teardown code here. This method is called after the invocation of each test method in the class.
  39. [super tearDown];
  40. }
  41. - (void)testExample {
  42. // This is an example of a functional test case.
  43. // Use XCTAssert and related functions to verify your tests produce the correct results.
  44. PsiphonTunnel *tunnel = [PsiphonTunnel newPsiphonTunnel:self.psiphonTunnelDelegate];
  45. XCTAssertNotNil(tunnel);
  46. }
  47. - (void)testPerformanceExample {
  48. // This is an example of a performance test case.
  49. [self measureBlock:^{
  50. // Put the code you want to measure the time of here.
  51. }];
  52. }
  53. @end