Example #1
0
        public void BuildTicketCashoutResponseDtoFromTicketCashoutResponseTest()
        {
            var dto    = TicketBuilderHelper.GetTicketCashoutResponse(null, SDK.Entities.Internal.Dto.TicketCashoutResponse.Status.Rejected);
            var ticket = new TicketCashoutResponseMapper(null).Map(dto, SR.S1000, null, dto.ToJson());

            TicketCompareHelper.Compare(ticket, dto);
        }
Example #2
0
        public void BuildMultiBetWithSameSelectionDifferentBankerTest()
        {
            var ticket = _builderFactory.CreateTicketBuilder()
                         .SetTicketId("ticket-" + SR.S1000)
                         .SetOddsChange(OddsChangeType.Any)
                         .SetSender(_sender)
                         .AddBet(_builderFactory.CreateBetBuilder().AddSelectedSystem(1).SetBetId("bet-id-" + SR.I1000).SetBetBonus(SR.I1000).SetStake(92343, StakeType.Total)
                                 .AddSelection(_builderFactory.CreateSelectionBuilder().SetEventId(9691139).SetIdLcoo(324, 1, "", "1").SetOdds(16000).SetBanker(true).Build())
                                 .Build())
                         .AddBet(_builderFactory.CreateBetBuilder().AddSelectedSystem(1).SetBetId("bet-id-" + SR.I1000).SetBetBonus(SR.I1000).SetStake(92343, StakeType.Total)
                                 .AddSelection(_builderFactory.CreateSelectionBuilder().SetEventId(9691139).SetIdLcoo(324, 1, "", "1").SetOdds(16000).SetBanker(false).Build())
                                 .Build())
                         .BuildTicket();

            Assert.IsNotNull(ticket);

            var dto  = new TicketMapper().Map(ticket);
            var json = dto.ToJson();

            var newDto = new TicketDTO {
                Ticket = Ticket.FromJson(json)
            };

            TicketCompareHelper.Compare(ticket, dto);
            TicketCompareHelper.Compare(ticket, newDto);
        }
Example #3
0
        public void BuildTicketCashoutDtoFromTicketTest()
        {
            var ticket = TicketBuilderHelper.GetTicketCashout();
            var dto    = new TicketCashoutMapper().Map(ticket);

            TicketCompareHelper.Compare(ticket, dto);
        }
Example #4
0
        public void BuildTicketReofferCancelDtoFromTicketTestW()
        {
            var ticket = TicketBuilderHelper.GetTicketReofferCancel();
            var dto    = new TicketReofferCancelMapper().Map(ticket);

            TicketCompareHelper.Compare(ticket, dto);
        }
Example #5
0
        public void BuildTicketCancelResponseDtoFromTicketCancelResponseTest()
        {
            var dto    = TicketBuilderHelper.GetTicketCancelResponse();
            var ticket = new TicketCancelResponseMapper(null).Map(dto, SR.S1000, null, dto.ToJson());

            TicketCompareHelper.Compare(ticket, dto);
        }
Example #6
0
        public void BuildTicketResponseFromTicketResponseDtoTest()
        {
            var json   = FileHelper.ReadFile(DirPath, @"ticket-response2.json");
            var dto    = TicketResponseDTO.FromJson(json);
            var ticket = new TicketResponseMapper(null).Map(dto, SR.S1000, null, dto.ToJson());

            TicketCompareHelper.Compare(ticket, dto);
        }
Example #7
0
        public void BuildTicketCancelAckDtoFromTicketCancelAckTest()
        {
            var ticket = new TicketCancelAck(SR.S1000, SR.I1000, TicketCancelAckStatus.NotCancelled, SR.I100, SR.S1000);
            var dto    = new TicketCancelAckMapper().Map(ticket);
            var json   = dto.ToJson();

            var newDto = TicketCancelAckDTO.FromJson(json);

            TicketCompareHelper.Compare(ticket, dto);
            TicketCompareHelper.Compare(ticket, newDto);
        }
Example #8
0
        public void BuildTicketResponseFromTicketResponseJson_ReceivedFromCustomerTest()
        {
            var json   = FileHelper.ReadFile(DirPath, @"ticket-response-customer.json");
            var dto    = TicketResponseDTO.FromJson(json);
            var ticket = new TicketResponseMapper(null).Map(dto, SR.S1000, null, dto.ToJson());

            TicketCompareHelper.Compare(ticket, dto);
            Assert.IsNotNull(ticket.BetDetails);
            Assert.IsNotNull(dto.Result.BetDetails.First().SelectionDetails);
            Assert.IsNull(ticket.BetDetails.First().SelectionDetails);
        }
Example #9
0
        public void BuildTicketAltStakeTest()
        {
            var ticket            = TicketBuilderHelper.GetTicket();
            var ticketResponseDto = TicketBuilderHelper.GetTicketResponse(ticket, Status.Rejected, false, true);
            var ticketResponse    = new TicketResponseMapper(null).Map(ticketResponseDto, S1000, null, ticketResponseDto.ToJson());

            Thread.Sleep(500);
            var reofferTicket = new BuilderFactoryHelper().BuilderFactory.CreateAltStakeBuilder().Set(ticket, ticketResponse, "altStakeTicket-" + I1000P).BuildTicket();

            Assert.IsNotNull(reofferTicket);
            TicketCompareHelper.Compare(ticket, reofferTicket, false, true);
        }
Example #10
0
        public void BuildTicketCancelDtoFromTicketCancelTest()
        {
            var ticket = TicketBuilderHelper.GetTicketCancel();
            var dto    = new TicketCancelMapper().Map(ticket);
            var json   = dto.ToJson();

            var newDto = new TicketCancelDTO {
                Cancel = Cancel.FromJson(json)
            };

            TicketCompareHelper.Compare(ticket, dto);
            TicketCompareHelper.Compare(ticket, newDto);
        }
Example #11
0
        public void BuildMultiTicketDtoFromTicketTest()
        {
            var ticket = TicketBuilderHelper.GetTicket(null, 0, 10, 3);
            var dto    = new TicketMapper().Map(ticket);
            var json   = dto.ToJson();

            var newDto = new TicketDTO {
                Ticket = Ticket.FromJson(json)
            };

            TicketCompareHelper.Compare(ticket, dto);
            TicketCompareHelper.Compare(ticket, newDto);
        }
Example #12
0
        public void GetJsonFromTicketTest()
        {
            var ticket = _builderFactory.CreateTicketBuilder()
                         .SetTicketId("T-" + DateTime.Now.Ticks)
                         .SetOddsChange(OddsChangeType.Any)
                         .SetSender(_builderFactory.CreateSenderBuilder()
                                    .SetBookmakerId(1)
                                    .SetLimitId(1)
                                    .SetSenderChannel(SenderChannel.Internet)
                                    .SetCurrency("EUR")
                                    .SetEndCustomer(IPAddress.Parse("1.2.3.4"), "Customer-" + DateTime.Now.Millisecond, "EN", "device1", 10000)
                                    .Build())
                         .AddBet(
                _builderFactory.CreateBetBuilder()
                .SetBetId("Bet-" + DateTime.Now.Ticks)
                .AddSelectedSystem(3)
                .SetStake(60000, StakeType.Total)
                .AddSelection(
                    _builderFactory.CreateSelectionBuilder()
                    .SetEventId("11050915")
                    .SetId("lcoo:20/5/*/1")
                    .SetOdds(14100)
                    .SetBanker(false)
                    .Build())
                .AddSelection(
                    _builderFactory.CreateSelectionBuilder()
                    .SetEventId("11029671")
                    .SetId("lcoo:339/5/1.5/2")
                    .SetOdds(16800)
                    .SetBanker(false)
                    .Build())
                .AddSelection(
                    _builderFactory.CreateSelectionBuilder()
                    .SetEventId("11052893")
                    .SetId("lcoo:20/5/*/2")
                    .SetOdds(16900)
                    .SetBanker(false)
                    .Build())
                .AddSelection(
                    _builderFactory.CreateSelectionBuilder()
                    .SetEventId("11052531")
                    .SetId("lcoo:20/5/*/2")
                    .SetOdds(15600)
                    .SetBanker(false)
                    .Build())
                .Build())
                         .AddBet(
                _builderFactory.CreateBetBuilder()
                .SetBetId("Bet-" + DateTime.Now.Ticks)
                .AddSelectedSystem(2)
                .SetStake(120000, StakeType.Total)
                .AddSelection(
                    _builderFactory.CreateSelectionBuilder()
                    .SetEventId("11029671")
                    .SetId("lcoo:339/5/1.5/2")
                    .SetOdds(16800)
                    .SetBanker(false)
                    .Build())
                .AddSelection(
                    _builderFactory.CreateSelectionBuilder()
                    .SetEventId("11052893")
                    .SetId("lcoo:20/5/*/2")
                    .SetOdds(16900)
                    .SetBanker(false)
                    .Build())
                .AddSelection(
                    _builderFactory.CreateSelectionBuilder()
                    .SetEventId("11052531")
                    .SetId("lcoo:20/5/*/2")
                    .SetOdds(15600)
                    .SetBanker(false)
                    .Build())
                .Build())
                         .AddBet(
                _builderFactory.CreateBetBuilder()
                .SetBetId("Bet-" + DateTime.Now.Ticks)
                .AddSelectedSystem(1)
                .SetStake(80000, StakeType.Total)
                .AddSelection(
                    _builderFactory.CreateSelectionBuilder()
                    .SetEventId("11029671")
                    .SetId("lcoo:339/5/1.5/2")
                    .SetOdds(16800)
                    .SetBanker(false)
                    .Build())
                .AddSelection(
                    _builderFactory.CreateSelectionBuilder()
                    .SetEventId("11052531")
                    .SetId("lcoo:20/5/*/2")
                    .SetOdds(15600)
                    .SetBanker(false)
                    .Build())
                .Build())
                         .BuildTicket();
            var dto  = new TicketMapper().Map(ticket);
            var json = dto.ToJson();

            var newDto = new TicketDTO {
                Ticket = Ticket.FromJson(json)
            };

            TicketCompareHelper.Compare(ticket, dto);
            TicketCompareHelper.Compare(ticket, newDto);
        }