Skip to content
Snippets Groups Projects
Select Git revision
  • f9ab0f41bf8785c2323d2ef7e64c3e526037656f
  • master default protected
  • jalon2
  • jalon1
4 results

IrisTest.java

Blame
  • IrisTest.java 1.12 KiB
    package fr.univlille.sae.classification.model;
    import javafx.scene.paint.Color;
    
    import org.junit.jupiter.api.Test;
    
    import static org.junit.jupiter.api.Assertions.*;
    
    class IrisTest {
    
        Iris iris = new Iris(2.8, 3.0, 1.9, 4.1, "Setosa");
    
        @Test
        void getSepalWidth() {
            assertEquals(3.0 , iris.getSepalWidth());
        }
    
        @Test
        void getSepalLength() {
            assertEquals(2.8, iris.getSepalLength());
        }
    
        @Test
        void getPetalWidth() {
            assertEquals(4.1, iris.getPetalWidth());
        }
    
        @Test
        void getPetalLength() {
            assertEquals(1.9, iris.getPetalLength());
        }
    
    
        @Test
        void getDataType() {
            assertEquals(3.0 , iris.getSepalWidth());
            assertEquals(2.8, iris.getSepalLength());
            assertEquals(4.1, iris.getPetalWidth());
            assertEquals(1.9, iris.getPetalLength());
        }
    
        @Test
        void getColor() {
            assertEquals(Color.RED, iris.getClassifications().get(iris.getClassification()));
        }
    
        @Test
        void testToString() {
            assertEquals("Iris{sepalLength=2.8, sepalWidth=3.0, petalLength=1.9, petalWidth=4.1}", iris.toString());
        }
    }