blob: 61ec3d83cc0a9f62379906006a3780c096e520c9 [file] [log] [blame]
package org.eclipse.papyrus.uml.diagram.clazz.lf.associationlabellayout.tests.locators.source;
import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.*;
import org.eclipse.draw2d.Connection;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.AssociationEditPart;
import org.eclipse.papyrus.uml.diagram.clazz.lf.associationlabellayout.locators.source.AssociatedSourceSegment;
import org.eclipse.papyrus.uml.diagram.clazz.lf.associationlabellayout.locators.source.SourceLocatorFactory;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.eclipse.draw2d.geometry.Point;
class AssociatedSegmentTest {
private AssociatedSourceSegment associatedSegment;
private IFigure iFigure;
private AssociationEditPart associationEditPart;
@BeforeEach
void setUp() throws Exception {
associationEditPart = Mockito.mock(AssociationEditPart.class);
iFigure = Mockito.mock(IFigure.class);
associatedSegment = SourceLocatorFactory.getInstance().createAssociatedSourceSegment(iFigure, associationEditPart);
}
@AfterEach
void tearDown() throws Exception {
}
@Test
void testGetStartingPoint() {
Connection parent = Mockito.mock(Connection.class);
PointList pointList = Mockito.mock(PointList.class);
Mockito.when(parent.getPoints()).thenReturn(pointList);
Mockito.when(pointList.toIntArray()).thenReturn(new int[] {1,2,3,4});
Mockito.when(iFigure.getParent()).thenReturn(parent);
Point point = associatedSegment.getStartingPoint();
// access rules to junit to edit
//assertEquals(point.x, 3);
//assertEquals(point.y, 4);
}
@Test
void testGetEndPoint() {
fail("Not yet implemented");
}
@Test
void testGetConnectedClass() {
fail("Not yet implemented");
}
@Test
void testAssociatedSegment() {
fail("Not yet implemented");
}
@Test
void testAbstractAssociatedSegment() {
fail("Not yet implemented");
}
@Test
void testGetGradient() {
fail("Not yet implemented");
}
@Test
void testGetYIntercept() {
fail("Not yet implemented");
}
@Test
void testGetAngle() {
fail("Not yet implemented");
}
@Test
void testDoesSegmentPointToBack() {
fail("Not yet implemented");
}
@Test
void testGetThePointDistantOf() {
fail("Not yet implemented");
}
}