コード例 #1
0
        public async Task GetCompressedAggregateTrades_Null_Throws()
        {
            // Arrange

            // Act

            // Assert
            await Assert.ThrowsAsync <ArgumentNullException>(() => ConcreteBinanceClient.GetCompressedAggregateTrades(null));
        }
コード例 #2
0
        public async Task GetCompressedAggregateTrades_NullSymbol_Throws()
        {
            // Arrange
            var request = new GetCompressedAggregateTradesRequest()
            {
                Symbol = null,
            };

            // Act

            // Assert
            await Assert.ThrowsAsync <ArgumentNullException>(() => ConcreteBinanceClient.GetCompressedAggregateTrades(request));
        }
コード例 #3
0
        public async Task GetCompressedAggregateTrades_StartTimeMin_Throws()
        {
            // Arrange
            var request = new GetCompressedAggregateTradesRequest()
            {
                Symbol    = "ETHBTC",
                StartTime = DateTime.MinValue,
            };

            // Act

            // Assert
            await Assert.ThrowsAsync <ArgumentNullException>(() => ConcreteBinanceClient.GetCompressedAggregateTrades(request));
        }
コード例 #4
0
        public async Task GetCompressedAggregateTrades_ValidRequest_CallsProcessGetRequest()
        {
            // Arrange
            var request = new GetCompressedAggregateTradesRequest()
            {
                Symbol    = "ETHBTC",
                StartTime = DateTime.UtcNow.AddHours(-1),
                EndTime   = DateTime.UtcNow,
            };

            // Act
            await ConcreteBinanceClient.GetCompressedAggregateTrades(request);

            // Assert
            MockAPIProcessor.Verify(i => i.ProcessGetRequest <List <CompressedAggregateTradeResponse> >(
                                        It.Is <BinanceEndpointData>(u => u.Uri.Equals(Endpoints.MarketData.CompressedAggregateTrades(request).Uri)),
                                        5000),
                                    Times.Once());
        }