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/EdgeTest.java

34 lines
635 B
Java
Raw 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 EdgeTest {
@Test
void newEdge() {
Edge e = new Edge();
assertNull(e.getFrom());
assertNull(e.getTo());
}
@Test
void setFrom() {
Edge e = new Edge();
Node n = new Node();
e.setFrom(n);
assertEquals(n, e.getFrom());
assertNull(e.getTo());
}
@Test
void setTo() {
Edge e = new Edge();
Node n = new Node();
e.setTo(n);
assertEquals(n, e.getTo());
assertNull(e.getFrom());
}
}