Debian Codegraph @

scala-unit-tests/src/test/scala/org/eclipse/collections/impl/IterableTestTrait.scala

raw
1 /*
2 * Copyright (c) 2021 Goldman Sachs.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * and Eclipse Distribution License v. 1.0 which accompany this distribution.
6 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7 * and the Eclipse Distribution License is available at
8 * http://www.eclipse.org/org/documents/edl-v10.php.
9 */
10
11 package org.eclipse.collections.impl
12
13 import org.junit.{Assert, Test}
14
15 trait IterableTestTrait
16 {
17 // Should contain "1", "2", "3" in order
18 val classUnderTest: java.lang.Iterable[String]
19
20 @Test
21 def iterator
22 {
23 var counter = 0
24 val iterator = this.classUnderTest.iterator
25 while (iterator.hasNext)
26 {
27 counter += 1
28 Assert.assertEquals(String.valueOf(counter), iterator.next)
29 }
30 }
31 }