#1313 Add Separated Interface design pattern
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package com.iluwatar.separatedinterface.taxes;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class DomesticTaxTest {
|
||||
|
||||
private DomesticTax target;
|
||||
|
||||
@Test
|
||||
public void testTaxCaluclation(){
|
||||
target = new DomesticTax();
|
||||
|
||||
var tax=target.calculate(100.0);
|
||||
Assertions.assertEquals(tax,20.0);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.iluwatar.separatedinterface.taxes;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class ForeignTaxTest {
|
||||
|
||||
private ForeignTax target;
|
||||
|
||||
@Test
|
||||
public void testTaxCaluclation(){
|
||||
target = new ForeignTax();
|
||||
|
||||
var tax=target.calculate(100.0);
|
||||
Assertions.assertEquals(tax,60.0);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user