-
Notifications
You must be signed in to change notification settings - Fork 599
/
immutablePrimitiveArrayStackTest.stg
65 lines (51 loc) · 2.21 KB
/
immutablePrimitiveArrayStackTest.stg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import "copyright.stg"
import "primitiveHashCode.stg"
import "primitiveLiteral.stg"
isTest() ::= "true"
skipBoolean() ::="true"
targetPath() ::= "org/eclipse/collections/impl/stack/immutable/primitive"
fileName(primitive) ::= "Immutable<primitive.name>ArrayStackTest"
class(primitive) ::= <<
<body(primitive.type, primitive.wrapperName, primitive.name)>
>>
body(type, wrapperName, name) ::= <<
<copyright()>
package org.eclipse.collections.impl.stack.immutable.primitive;
import org.eclipse.collections.api.stack.primitive.Immutable<name>Stack;
import org.eclipse.collections.impl.list.mutable.primitive.<name>ArrayList;
import org.eclipse.collections.impl.math.Mutable<wrapperName>;
import org.eclipse.collections.impl.stack.mutable.primitive.<name>ArrayStack;
import org.junit.Assert;
import org.junit.Test;
/**
* JUnit test for {@link Immutable<name>ArrayStack}.
* This file was automatically generated from template file immutablePrimitiveArrayStackTest.stg.
*/
public class Immutable<name>ArrayStackTest extends AbstractImmutable<name>StackTestCase
{
@Override
protected Immutable<name>Stack classUnderTest()
{
return Immutable<name>ArrayStack.newStackWith(<["1", "2", "3"]:(literal.(type))(); separator=", ">);
}
@Test
public void newWithIterable()
{
Assert.assertEquals(<name>ArrayStack.newStackWith(<["1", "2", "3"]:(literal.(type))(); separator=", ">), this.newWithIterable(<name>ArrayList.newListWith(<["1", "2", "3"]:(literal.(type))(); separator=", ">)));
}
@Test
public void newWithTopToBottom()
{
Assert.assertEquals(<name>ArrayStack.newStackFromTopToBottom(<["1", "2", "3"]:(literal.(type))(); separator=", ">), this.newWithTopToBottom(<["1", "2", "3"]:(literal.(type))(); separator=", ">));
}
@Override
@Test
public void injectInto()
{
super.injectInto();
Immutable<name>ArrayStack iterable = Immutable<name>ArrayStack.newStackWith(<["1", "2", "3"]:(literal.(type))(); separator=", ">);
Mutable<wrapperName> result = iterable.injectInto(new Mutable<wrapperName>(<(literal.(type))("0")>), Mutable<wrapperName>::add);
Assert.assertEquals(new Mutable<wrapperName>(<(literal.(type))("6")>), result);
}
}
>>