RunnerTests.m 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. #import <Flutter/Flutter.h>
  2. #import <UIKit/UIKit.h>
  3. #import <XCTest/XCTest.h>
  4. @import compdfkit_flutter;
  5. // This demonstrates a simple unit test of the Objective-C portion of this plugin's implementation.
  6. //
  7. // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
  8. @interface RunnerTests : XCTestCase
  9. @end
  10. @implementation RunnerTests
  11. - (void)testExample {
  12. CompdfkitFlutterPlugin *plugin = [[CompdfkitFlutterPlugin alloc] init];
  13. FlutterMethodCall *call = [FlutterMethodCall methodCallWithMethodName:@"getPlatformVersion"
  14. arguments:nil];
  15. XCTestExpectation *expectation = [self expectationWithDescription:@"result block must be called"];
  16. [plugin handleMethodCall:call
  17. result:^(id result) {
  18. NSString *expected = [NSString
  19. stringWithFormat:@"iOS %@", UIDevice.currentDevice.systemVersion];
  20. XCTAssertEqualObjects(result, expected);
  21. [expectation fulfill];
  22. }];
  23. [self waitForExpectationsWithTimeout:1 handler:nil];
  24. }
  25. @end