Adding marker interfaces UT

This commit is contained in:
soufiane-cheouati 2019-02-01 20:18:24 +00:00 committed by GitHub
parent ec0ec38b06
commit f76d6bd668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 0 deletions

View File

@ -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);
}
}