public void GetBets_Should_Throw_Exception_If_Status_Not_Ok()
        {
            var client = new Mock <ICustomerBetClient>();

            client.Setup(t => t.GetAsync("api/GetBets?code=code123&name=user123"))
            .ReturnsAsync(GenerateResponse <IEnumerable <BetDto> >(null, HttpStatusCode.NotFound));

            var target = new CustomerBetService(client.Object, _settings.Object);

            var ex = Assert.ThrowsAsync <Exception>(() => target.GetBetsAsync());

            Assert.That(ex.Message, Is.EqualTo("Failed to get the bets"));
        }
        public async Task GetBet_Can_Get_All_Bets()
        {
            var client = new Mock <ICustomerBetClient>();

            client.Setup(t => t.GetAsync("api/GetBets?code=code123&name=user123"))
            .ReturnsAsync(GenerateResponse <IEnumerable <BetDto> >(new[]
            {
                new BetDto {
                    RaceId = 100
                },
                new BetDto {
                    RaceId = 200
                },
            }, HttpStatusCode.OK));


            var target = new CustomerBetService(client.Object, _settings.Object);
            var result = (await target.GetBetsAsync()).ToArray();

            Assert.That(result.Length, Is.EqualTo(2));
            Assert.That(result[0].RaceId, Is.EqualTo(100));
            Assert.That(result[1].RaceId, Is.EqualTo(200));
        }