public virtual void GetOpenOrders_NotAuthenticated_ShouldThrowException() { bool exceptionThrown = false; // Arrange BitmexAPI exchange = new BitmexAPI(new BitmexAPIStub()); // Act (one single action only) try { exchange.GetOpenOrders("XBTUSD"); } catch (Exception) { exceptionThrown = true; } // Assert Assert.IsTrue(exceptionThrown); }
public virtual void GetOpenOrders_ShouldSuccess() { // Arrange BitmexAPI exchange = new BitmexAPI(new BitmexAPIStub()); exchange.SetKeys("some_dummy_key", "some_dummy_secret"); // Act (one single action only) IList <Order> openOrders = exchange.GetOpenOrders("XBTUSD"); // Assert Assert.IsNotNull(openOrders); }
public virtual void GetOpenOrders_BadSymbol_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.GetOpenOrders(null); } catch (Exception) { exceptionThrown = true; } // Assert Assert.IsTrue(exceptionThrown); }