Assert: assertEquals(String message, double expected, double actual, double precision) : TestCase « junit.framework « Java by API






Assert: assertEquals(String message, double expected, double actual, double precision)

 

import static org.junit.Assert.assertEquals;
import junit.framework.JUnit4TestAdapter;

import org.junit.Test;

public class Main{

  public static void main (String... args) {
    junit.textui.TestRunner.run (suite());
  }
  
  public static junit.framework.Test suite() {
    return new JUnit4TestAdapter(Main.class);
  }
  
  @Test public void testCopy() {
        assertEquals("Capacity", 11.991, 11.99, 0.1);
  }
}

   
  








Related examples in the same category

1.extends TestCase
2.Assert.fail(String message)
3.Assert: assertEquals(Object expected, Object actual)
4.Assert: assertEquals(String expected, String actual)
5.Assert: assertEquals(int expected, int actual)
6.Assert: assertFalse(String message, boolean value)
7.Assert: assertNotSame(String message, Object expected, Object actual)
8.Assert: assertNull(String message, Object value)
9.Assert: assertSame(String message, Object expected, Object actual)
10.Assert: assertTrue(String message, boolean value)