Adding marker interfaces UT
This commit is contained in:
parent
ec0ec38b06
commit
f76d6bd668
|
@ -0,0 +1,26 @@
|
|||
package com.baeldung.markerinterface;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class MarkerInterfaceUnitTest {
|
||||
|
||||
@Test
|
||||
public void givenDeletableObjectThenTrueReturned() {
|
||||
ShapeDao shapeDao = new ShapeDao();
|
||||
Object rectangle = new Rectangle(2, 3);
|
||||
|
||||
boolean result = shapeDao.delete(rectangle);
|
||||
assertEquals(true, result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenNonDeletableObjectThenFalseReturned() {
|
||||
ShapeDao shapeDao = new ShapeDao();
|
||||
Object object = new Object();
|
||||
|
||||
boolean result = shapeDao.delete(object);
|
||||
assertEquals(false, result);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue