Search in sources :

Example 1 with VaultSupport

use of io.github.wysohn.triggerreactor.bukkit.manager.trigger.share.api.vault.VaultSupport in project TriggerReactor by wysohn.

the class TestExecutors method testMoney.

@Test
public void testMoney() throws Exception {
    VaultSupport vVault = Mockito.mock(VaultSupport.class);
    Player vp = Mockito.mock(Player.class);
    JsTest test = new ExecutorTest(engine, "MONEY").addVariable("vault", vVault).addVariable("player", vp);
    test.withArgs(30).test();
    Mockito.verify(vVault).give(vp, 30);
    test.withArgs(-30).test();
    Mockito.verify(vVault).take(vp, 30);
    assertJSError(() -> test.withArgs().test(), "Invalid parameter! [Number]");
    assertJSError(() -> test.withArgs("nuu").test(), "Invalid parameter! [Number]");
}
Also used : Player(org.bukkit.entity.Player) VaultSupport(io.github.wysohn.triggerreactor.bukkit.manager.trigger.share.api.vault.VaultSupport) JsTest(js.JsTest) ExecutorTest(js.ExecutorTest) Test(org.junit.Test) ExecutorTest(js.ExecutorTest) JsTest(js.JsTest)

Aggregations

VaultSupport (io.github.wysohn.triggerreactor.bukkit.manager.trigger.share.api.vault.VaultSupport)1 ExecutorTest (js.ExecutorTest)1 JsTest (js.JsTest)1 Player (org.bukkit.entity.Player)1 Test (org.junit.Test)1