예제 #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());
        }