コード例 #1
0
        public virtual void CancelAllOrders_NotAuthenticated_ShouldThrowException()
        {
            bool exceptionThrown = false;

            // Arrange
            BitmexAPI exchange = new BitmexAPI(new BitmexAPIStub());

            // Act (one single action only)
            try { exchange.CancelAllOrders("XBTUSD"); } catch (Exception) { exceptionThrown = true; }

            // Assert
            Assert.IsTrue(exceptionThrown);
        }
コード例 #2
0
        public virtual void CancelAllOrders_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.CancelAllOrders(null); } catch (Exception) { exceptionThrown = true; }

            // Assert
            Assert.IsTrue(exceptionThrown);
        }
コード例 #3
0
        public virtual void CancelAllOrders_ShouldSuccess()
        {
            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.CancelAllOrders("XBTUSD"); } catch { exceptionThrown = true; }

            // Assert
            Assert.IsFalse(exceptionThrown);
        }