Ejemplo n.º 1
0
        public async Task SetResultsShouldHandleMissingReport()
        {
            var orders = new PlaceExecutionReportStub("MarketId", "SUCCESS");

            orders.AddReport(new LimitOrderBuilder(98765, Side.Lay, 1.01, 2.00), "1", "SUCCESS", "EXECUTION_COMPLETE");

            var order = new LimitOrderBuilder(12345, Side.Back, 1.01, 2.00);

            orders.AddNullReport(order);

            orders.SetReturnContent(_service);

            await _orderService.Place("MarketId", orders.LimitOrders);

            Assert.Equal(0, order.Object.SizeMatched);
        }
Ejemplo n.º 2
0
        public async Task ResultsAreSet(double size, double price, string status)
        {
            var orders = new PlaceExecutionReportStub("MarketId", "SUCCESS");

            orders.AddReport(new LimitOrderBuilder(98765, Side.Lay, -1, -1), "1", "SUCCESS", "EXECUTION_COMPLETE");

            var order = new LimitOrderBuilder(12345, Side.Back, price, size);

            orders.AddReport(order, "2", status, "EXECUTION_COMPLETE");

            orders.SetReturnContent(_service);

            await _orderService.Place("MarketId", orders.LimitOrders);

            Assert.NotEqual("1", order.Object.BetId);
            Assert.Equal("2", order.Object.BetId);
            Assert.Equal(size, order.Object.SizeMatched);
            Assert.Equal(price, order.Object.AveragePriceMatched);
            Assert.Equal(status, order.Object.Status);
            Assert.Equal("EXECUTION_COMPLETE", order.Object.OrderStatus);
            Assert.Equal(DateTime.Parse("2013-10-30T14:22:47.000Z", new DateTimeFormatInfo()), order.Object.PlacedDate);
        }