-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
24 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 17 additions & 5 deletions
22
Java/src/test/java/org/codecop/dependencies/d/ShippingCostTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,27 @@ | ||
package org.codecop.dependencies.d; | ||
|
||
import org.junit.Test; | ||
import static org.junit.Assert.assertEquals; | ||
import static org.mockito.Mockito.mock; | ||
import static org.mockito.Mockito.when; | ||
|
||
import static org.junit.Assert.assertNotNull; | ||
import org.junit.Test; | ||
|
||
public class ShippingCostTest { | ||
|
||
@Test | ||
public void test4() { | ||
ShippingCost shippingCost = new ShippingCost(); | ||
|
||
assertNotNull(shippingCost); | ||
RestCountriesAPI restCountriesAPI = mock(RestCountriesAPI.class); | ||
when(restCountriesAPI.isInCommonMarket(new Country("AT"))).thenReturn(true); | ||
ShippingCost shippingCost = new ShippingCost() { | ||
@Override | ||
protected RestCountriesAPI getRestCountriesApi() { | ||
return restCountriesAPI; | ||
} | ||
}; | ||
|
||
Money cost = shippingCost.calculate(new Country("AT"), DeliveryOptions.STANDARD); | ||
|
||
assertEquals(new Money(5), cost); | ||
// 3 seconds | ||
} | ||
} |