示例#1
0
 public virtual void test_parsePutCall()
 {
     assertEquals(LoaderUtils.parsePutCall("PUT"), PutCall.PUT);
     assertEquals(LoaderUtils.parsePutCall("Put"), PutCall.PUT);
     assertEquals(LoaderUtils.parsePutCall("put"), PutCall.PUT);
     assertEquals(LoaderUtils.parsePutCall("p"), PutCall.PUT);
     assertEquals(LoaderUtils.parsePutCall("CALL"), PutCall.CALL);
     assertEquals(LoaderUtils.parsePutCall("Call"), PutCall.CALL);
     assertEquals(LoaderUtils.parsePutCall("call"), PutCall.CALL);
     assertEquals(LoaderUtils.parsePutCall("c"), PutCall.CALL);
     assertThrowsIllegalArg(() => LoaderUtils.parseBoolean("Rubbish"));
 }
示例#2
0
 public virtual void test_parseBuySell()
 {
     assertEquals(LoaderUtils.parseBuySell("BUY"), BuySell.BUY);
     assertEquals(LoaderUtils.parseBuySell("Buy"), BuySell.BUY);
     assertEquals(LoaderUtils.parseBuySell("buy"), BuySell.BUY);
     assertEquals(LoaderUtils.parseBuySell("b"), BuySell.BUY);
     assertEquals(LoaderUtils.parseBuySell("SELL"), BuySell.SELL);
     assertEquals(LoaderUtils.parseBuySell("Sell"), BuySell.SELL);
     assertEquals(LoaderUtils.parseBuySell("sell"), BuySell.SELL);
     assertEquals(LoaderUtils.parseBuySell("s"), BuySell.SELL);
     assertThrowsIllegalArg(() => LoaderUtils.parseBoolean("Rubbish"));
 }
示例#3
0
 public virtual void test_parsePayReceive()
 {
     assertEquals(LoaderUtils.parsePayReceive("PAY"), PayReceive.PAY);
     assertEquals(LoaderUtils.parsePayReceive("Pay"), PayReceive.PAY);
     assertEquals(LoaderUtils.parsePayReceive("pay"), PayReceive.PAY);
     assertEquals(LoaderUtils.parsePayReceive("p"), PayReceive.PAY);
     assertEquals(LoaderUtils.parsePayReceive("RECEIVE"), PayReceive.RECEIVE);
     assertEquals(LoaderUtils.parsePayReceive("Receive"), PayReceive.RECEIVE);
     assertEquals(LoaderUtils.parsePayReceive("receive"), PayReceive.RECEIVE);
     assertEquals(LoaderUtils.parsePayReceive("rec"), PayReceive.RECEIVE);
     assertEquals(LoaderUtils.parsePayReceive("r"), PayReceive.RECEIVE);
     assertThrowsIllegalArg(() => LoaderUtils.parseBoolean("Rubbish"));
 }
示例#4
0
 public virtual void test_parseBoolean()
 {
     assertEquals(LoaderUtils.parseBoolean("TRUE"), true);
     assertEquals(LoaderUtils.parseBoolean("True"), true);
     assertEquals(LoaderUtils.parseBoolean("true"), true);
     assertEquals(LoaderUtils.parseBoolean("t"), true);
     assertEquals(LoaderUtils.parseBoolean("yes"), true);
     assertEquals(LoaderUtils.parseBoolean("y"), true);
     assertEquals(LoaderUtils.parseBoolean("FALSE"), false);
     assertEquals(LoaderUtils.parseBoolean("False"), false);
     assertEquals(LoaderUtils.parseBoolean("false"), false);
     assertEquals(LoaderUtils.parseBoolean("f"), false);
     assertEquals(LoaderUtils.parseBoolean("no"), false);
     assertEquals(LoaderUtils.parseBoolean("n"), false);
     assertThrowsIllegalArg(() => LoaderUtils.parseBoolean("Rubbish"));
 }