RunnerTests.swift 797 B

12345678910111213141516171819202122232425262728
  1. import Cocoa
  2. import FlutterMacOS
  3. import XCTest
  4. @testable import photo_classify
  5. // This demonstrates a simple unit test of the Swift portion of this plugin's implementation.
  6. //
  7. // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
  8. class RunnerTests: XCTestCase {
  9. func testGetPlatformVersion() {
  10. let plugin = PhotoClassifyPlugin()
  11. let call = FlutterMethodCall(methodName: "getPlatformVersion", arguments: [])
  12. let resultExpectation = expectation(description: "result block must be called.")
  13. plugin.handle(call) { result in
  14. XCTAssertEqual(result as! String,
  15. "macOS " + ProcessInfo.processInfo.operatingSystemVersionString)
  16. resultExpectation.fulfill()
  17. }
  18. waitForExpectations(timeout: 1)
  19. }
  20. }