BAEL-4936: Removed similar methods as per review comments

This commit is contained in:
Vikas Ramsingh Rajput 2021-05-23 16:14:00 +05:30
parent dd73b72fc9
commit 199d80fb34
1 changed files with 0 additions and 15 deletions

View File

@ -1,6 +1,5 @@
package com.baeldung.interfaceVsAbstractClass;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
@ -13,24 +12,10 @@ public class InterfaceVsAbstractClassUnitTest {
assertTrue(redCircle.isValid());
}
@Test
public void givenAbstractClass_whenInvalidCircleUsedThenFail() {
CircleClass redCircle = new ChildCircleClass();
redCircle.setColor("WHITE");
assertFalse(redCircle.isValid());
}
@Test
public void givenInterface_whenValidCircleWithoutStateUsedThenPass() {
ChidlCircleInterfaceImpl redCircleWithoutState = new ChidlCircleInterfaceImpl();
redCircleWithoutState.setColor("RED");
assertTrue(redCircleWithoutState.isValid(redCircleWithoutState.getColor()));
}
@Test
public void givenInterface_whenInvalidCircleWithoutStateUsedThenFail() {
ChidlCircleInterfaceImpl redCircleWithoutState = new ChidlCircleInterfaceImpl();
redCircleWithoutState.setColor("WHITE");
assertFalse(redCircleWithoutState.isValid(redCircleWithoutState.getColor()));
}
}