void check1()

in LibTest/collection/IterableMixin/IterableMixin_class_A01_t02.dart [117:182]


void check1(MyIterable myIterable) {
  Expect.equals(1, myIterable.first);

  Expect.isFalse(myIterable.isEmpty);

  Expect.isTrue(myIterable.isNotEmpty);

  Expect.equals(1, myIterable.last);

  Expect.equals(1, myIterable.length);

  Expect.equals(1, myIterable.single);

  Expect.isTrue(myIterable.any((element) => true));

  Expect.isTrue(myIterable.contains(1));

  Expect.equals(1, myIterable.elementAt(0));

  Expect.isTrue(myIterable.every((element) => true));

  Iterable expanded = myIterable.expand((var element) => [element]);
  Expect.equals(1, expanded.length);

  Expect.equals(1, myIterable.firstWhere((element) => true));

  Expect.equals(1, myIterable.fold<int>(0, (int prev, element) => prev + element as int));

  Expect.throws(() {
    myIterable.forEach((e) {
      throw new Exception();
    });
  });

  Expect.equals("1", myIterable.join(","));

  Expect.equals(1, myIterable.lastWhere((element) => true));

  Expect.isFalse(myIterable.map((element) => element).isEmpty);

  Expect.equals(1, myIterable.reduce((value, element) => value + element));

  Expect.equals(1, myIterable.singleWhere((element) => true));

  Expect.isFalse(myIterable.skip(0).isEmpty);
  Expect.throws(() {
    myIterable.skip(-1);
  });

  Expect.isFalse(myIterable.skipWhile((element) => false).isEmpty);

  Expect.isFalse(myIterable.take(1).isEmpty);
  Expect.throws(() {
    myIterable.take(-1);
  });

  Expect.isFalse(myIterable.takeWhile((element) => true).isEmpty);
  Expect.isTrue(myIterable.takeWhile((element) => false).isEmpty);

  Expect.isFalse(myIterable.toList().isEmpty);
  Expect.isFalse(myIterable.toList(growable: false).isEmpty);

  Expect.isFalse(myIterable.toSet().isEmpty);

  Expect.isFalse(myIterable.where((element) => true).isEmpty);
}