示例#1
0
        public virtual void GetOrder_ShouldSuccess()
        {
            // Arrange
            OkexTokenAPI exchange = new OkexTokenAPI(new OkexTokenAPIStub());

            exchange.SetKeys("some_dummy_key", "some_dummy_secret", "some_dummy_passphrase");

            // Act (one single action only)
            Order order = exchange.GetOrder("BTC-USDT", "some_order_id");

            // Assert
            Assert.IsNotNull(order);
        }
示例#2
0
        public virtual void GetOrder_NotAuthenticated_ShouldThrowException()
        {
            bool exceptionThrown = false;

            // Arrange
            OkexTokenAPI exchange = new OkexTokenAPI(new OkexTokenAPIStub());

            // Act (one single action only)
            try { exchange.GetOrder("BTC-USDT", "some_order_id"); } catch (Exception) { exceptionThrown = true; }

            // Assert
            Assert.IsTrue(exceptionThrown);
        }
示例#3
0
        public virtual void GetOrder_BadOrderId_ShouldThrowException()
        {
            bool exceptionThrown = false;

            // Arrange
            OkexTokenAPI exchange = new OkexTokenAPI(new OkexTokenAPIStub());

            exchange.SetKeys("some_dummy_key", "some_dummy_secret", "some_dummy_passphrase");

            // Act (one single action only)
            try { exchange.GetOrder("BTC-USDT", null); } catch (Exception) { exceptionThrown = true; }

            // Assert
            Assert.IsTrue(exceptionThrown);
        }