Navaron Bracke

add XCTest stubs for iOS & MacOS

  1 +import Flutter
  2 +import UIKit
  3 +import XCTest
  4 +
  5 +@testable import mobile_scanner
  6 +
  7 +// This demonstrates a simple unit test of the Swift portion of this plugin's implementation.
  8 +//
  9 +// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
  10 +
  11 +class RunnerTests: XCTestCase {
  12 +
  13 + // TODO: this test was left as-is from the template, but it obviuosly fails for now.
  14 + // Add new tests later.
  15 + /*
  16 + func testGetPlatformVersion() {
  17 + let plugin = MobileScannerPlugin()
  18 +
  19 + let call = FlutterMethodCall(methodName: "getPlatformVersion", arguments: [])
  20 +
  21 + let resultExpectation = expectation(description: "result block must be called.")
  22 + plugin.handle(call) { result in
  23 + XCTAssertEqual(result as! String, "iOS " + UIDevice.current.systemVersion)
  24 + resultExpectation.fulfill()
  25 + }
  26 + waitForExpectations(timeout: 1)
  27 + }*/
  28 +
  29 +}
  1 +import FlutterMacOS
  2 +import Cocoa
  3 +import XCTest
  4 +
  5 +@testable import mobile_scanner
  6 +
  7 +// This demonstrates a simple unit test of the Swift portion of this plugin's implementation.
  8 +//
  9 +// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
  10 +
  11 +class RunnerTests: XCTestCase {
  12 +
  13 + // TODO: this test was left as-is from the template, but it obviuosly fails for now.
  14 + // Add new tests later.
  15 + /*
  16 + func testGetPlatformVersion() {
  17 + let plugin = MobileScannerPlugin()
  18 +
  19 + let call = FlutterMethodCall(methodName: "getPlatformVersion", arguments: [])
  20 +
  21 + let resultExpectation = expectation(description: "result block must be called.")
  22 + plugin.handle(call) { result in
  23 + XCTAssertEqual(result as! String,
  24 + "macOS " + ProcessInfo.processInfo.operatingSystemVersionString)
  25 + resultExpectation.fulfill()
  26 + }
  27 + waitForExpectations(timeout: 1)
  28 + }*/
  29 +
  30 +}