Skip to content

Commit

Permalink
added ElementValueArrayInitializerElementValueTest
Browse files Browse the repository at this point in the history
  • Loading branch information
nbauma109 committed May 21, 2023
1 parent 75e629d commit f1079ee
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class ElementValueArrayInitializerElementValue implements BaseElementValu
private final BaseElementValue elementValueArrayInitializer;

public ElementValueArrayInitializerElementValue() {
this.elementValueArrayInitializer = null;
this(null);
}

public ElementValueArrayInitializerElementValue(BaseElementValue elementValueArrayInitializer) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.jd.core.v1.model.javasyntax.reference;

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

public class ElementValueArrayInitializerElementValueTest {

@Test
public void testElementValueArrayInitializerElementValue() {
// Arrange & Act
ElementValueArrayInitializerElementValue noArgsElementValue = new ElementValueArrayInitializerElementValue();

// Assert
assertNull(noArgsElementValue.getElementValueArrayInitializer());
assertEquals("ElementValueArrayInitializerElementValue{null}", noArgsElementValue.toString());

// Act
ElementValueArrayInitializerElementValue elementValueArrayInitializerElementValue = new ElementValueArrayInitializerElementValue();

// Assert
assertNull(elementValueArrayInitializerElementValue.getElementValueArrayInitializer());
assertEquals("ElementValueArrayInitializerElementValue{null}", elementValueArrayInitializerElementValue.toString());

// Act & Assert for visitor
TestReferenceVisitor visitor = new TestReferenceVisitor();
elementValueArrayInitializerElementValue.accept(visitor);
assertEquals(1, visitor.getVisitElementValueArrayInitializerElementValueCount());
}
}

0 comments on commit f1079ee

Please sign in to comment.