public virtual void NewOrder_NoTriggerForStopMarketOrders_ShouldThrowException() { bool exceptionThrown = false; // Arrange BitmexAPI exchange = new BitmexAPI(new BitmexAPIStub()); // Act (one single action only) try { exchange.NewOrder("XBTUSD", OrderType.StopMarket, 100, OrderSide.Buy, null); } catch (Exception) { exceptionThrown = true; } // Assert Assert.IsTrue(exceptionThrown); }
public virtual void NewOrder_NoSideForCloseLimitOrders_ShouldThrowException() { bool exceptionThrown = false; // Arrange BitmexAPI exchange = new BitmexAPI(new BitmexAPIStub()); // Act (one single action only) try { exchange.NewOrder("XBTUSD", OrderType.CloseLimit, 100, null, 10000, null); } catch (Exception) { exceptionThrown = true; } // Assert Assert.IsTrue(exceptionThrown); }
public virtual void NewOrder_CloseMarketSell_ShouldSuccess() { // Arrange BitmexAPI exchange = new BitmexAPI(new BitmexAPIStub()); exchange.SetKeys("some_dummy_key", "some_dummy_secret"); // Act (one single action only) string orderID = exchange.NewOrder("XBTUSD", OrderType.CloseMarket, 100, OrderSide.Sell, null, null); // Assert Assert.IsNotNull(orderID); }
public virtual void NewOrder_NoPriceForLimitOrders_ShouldThrowException() { bool exceptionThrown = false; // Arrange BitmexAPI exchange = new BitmexAPI(new BitmexAPIStub()); exchange.SetKeys("some_dummy_key", "some_dummy_secret"); // Act (one single action only) try { exchange.NewOrder("XBTUSD", OrderType.Limit, 100, OrderSide.Buy, null, null); } catch (Exception) { exceptionThrown = true; } // Assert Assert.IsTrue(exceptionThrown); }