This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
sp-03/test/ch/usi/inf/sp/cfg/NodeTest.java

34 lines
734 B
Java
Raw Permalink Normal View History

2023-10-09 07:08:58 +00:00
package ch.usi.inf.sp.cfg;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class NodeTest {
@Test
void newNode() {
Node n = new Node();
assertEquals(0, n.getInEdges().size());
assertEquals(0, n.getOutEdges().size());
}
@Test
void addInEdge() {
Node n = new Node();
Edge e = new Edge();
n.addInEdge(e);
assertEquals(1, n.getInEdges().size());
assertSame(e, n.getInEdges().get(0));
}
@Test
void addOutEdge() {
Node n = new Node();
Edge e = new Edge();
n.addOutEdge(e);
assertEquals(1, n.getOutEdges().size());
assertSame(e, n.getOutEdges().get(0));
}
}