Iterator<Property> firstPropertyIter = mock(Iterator.class);
EList<Property> secondProperties = mock(EList.class);
Iterator<Property> secondPropertyIter = mock(Iterator.class);
Property firstProperty = mock(Property.class);
Type firstType = mock(Type.class);
String firstName = "type";
Property secondProperty = mock(Property.class);
Type secondType = mock(Type.class);
String secondName = "count";
EList<Comment> comments = mock(EList.class,
Answers.RETURNS_DEEP_STUBS.get());
when(clazz.getAttributes()).thenReturn(firstProperties).thenReturn(
secondProperties);
when(firstProperties.iterator()).thenReturn(firstPropertyIter);
when(firstPropertyIter.hasNext()).thenReturn(true).thenReturn(true)
.thenReturn(false);
when(firstPropertyIter.next()).thenReturn(firstProperty).thenReturn(
secondProperty);
when(secondProperties.iterator()).thenReturn(secondPropertyIter);
when(secondPropertyIter.hasNext()).thenReturn(true).thenReturn(true)
.thenReturn(false);
when(secondPropertyIter.next()).thenReturn(firstProperty).thenReturn(
secondProperty);
when(firstProperty.getType()).thenReturn(firstType);
when(firstProperty.getName()).thenReturn(firstName);
when(firstProperty.getUpper()).thenReturn(1);
when(firstProperty.getLower()).thenReturn(1);
when(firstProperty.getOwnedComments()).thenReturn(comments);
when(firstType.getName()).thenReturn("String");
when(firstType.getQualifiedName()).thenReturn("String");
when(secondProperty.getType()).thenReturn(secondType);
when(secondProperty.getName()).thenReturn(secondName);
when(secondProperty.getUpper()).thenReturn(1);
when(secondProperty.getLower()).thenReturn(1);
when(secondProperty.getOwnedComments()).thenReturn(comments);
when(secondType.getName()).thenReturn("Integer");
when(secondType.getQualifiedName()).thenReturn("Integer");
enumGenerator.generateConstructor(clazz, ast, ed);