import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;

import org.junit.jupiter.api.Test;

class ColorPointTest {
    private final Point p = new Point(1, 2);
    private final ColorPoint red = new ColorPoint(1, 2, "rojo");

    @Test
    void equalsIsSymmetricAgain() {
        assertFalse(p.equals(red));
        assertFalse(red.equals(p));
    }

    @Test
    void asPointGivesTheUnderlyingPoint() {
        assertEquals(p, red.asPoint());
    }

    @Test
    void colorMatters() {
        assertNotEquals(red, new ColorPoint(1, 2, "azul"));
        assertEquals(red, new ColorPoint(1, 2, "rojo"));
        assertEquals(red.hashCode(), new ColorPoint(1, 2, "rojo").hashCode());
    }
}
