mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-27 12:38:40 +01:00
Add a price test
This commit is contained in:
parent
cb126f22cf
commit
20e686f3b8
@ -1,5 +1,6 @@
|
|||||||
package com.Acrobot.ChestShop.Tests;
|
package com.Acrobot.ChestShop.Tests;
|
||||||
|
|
||||||
|
import com.Acrobot.Breeze.Utils.PriceUtil;
|
||||||
import com.Acrobot.ChestShop.Events.PreShopCreationEvent;
|
import com.Acrobot.ChestShop.Events.PreShopCreationEvent;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
@ -40,5 +41,15 @@ public class PriceCheckerTest {
|
|||||||
event = new PreShopCreationEvent(null, null, getPriceString("B 1S0"));
|
event = new PreShopCreationEvent(null, null, getPriceString("B 1S0"));
|
||||||
onPreShopCreation(event);
|
onPreShopCreation(event);
|
||||||
assertTrue(event.isCancelled());
|
assertTrue(event.isCancelled());
|
||||||
|
|
||||||
|
String priceString = "5 B 5";
|
||||||
|
assertTrue(PriceUtil.getBuyPrice(priceString) == PriceUtil.NO_PRICE);
|
||||||
|
|
||||||
|
priceString = "5 S 5";
|
||||||
|
assertTrue(PriceUtil.getSellPrice(priceString) == PriceUtil.NO_PRICE);
|
||||||
|
|
||||||
|
priceString = "5 B 5:5 S 5";
|
||||||
|
assertTrue(PriceUtil.getBuyPrice(priceString) == PriceUtil.NO_PRICE);
|
||||||
|
assertTrue(PriceUtil.getSellPrice(priceString) == PriceUtil.NO_PRICE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user