android_device_test.dart 946 Bytes
Newer Older
1 2 3 4
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5
import 'package:flutter_tools/src/device.dart';
6 7 8 9 10 11 12 13 14 15 16 17
import 'package:test/test.dart';

main() => defineTests();

defineTests() {
  group('android_device', () {
    test('uses the correct default ID', () {
      AndroidDevice android = new AndroidDevice();
      expect(android.id, equals(AndroidDevice.defaultDeviceID));
    });

    test('stores the requested id', () {
18 19 20
      String deviceId = '1234';
      AndroidDevice android = new AndroidDevice(id: deviceId);
      expect(android.id, equals(deviceId));
21 22 23 24
    });

    test('correctly creates only one of each requested device id', () {
      String deviceID = '1234';
25 26
      AndroidDevice a1 = new AndroidDevice(id: deviceID);
      AndroidDevice a2 = new AndroidDevice(id: deviceID);
27 28 29 30
      expect(a1, equals(a2));
    });
  });
}