예제 #1
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);
        }
예제 #2
0
        public void BuildTicketDtoFromJsonMultiSelectionTest()
        {
            var json = FileHelper.ReadFile(DirPath, @"ticket-multiselection.json");

            var dto = Ticket.FromJson(json);

            Assert.IsNotNull(dto);
            Assert.IsNotNull(dto.Sender);
        }
예제 #3
0
        public void BuildTicketDtoFromTicketTest()
        {
            var ticket = TicketBuilderHelper.GetTicket();
            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);
        }
예제 #4
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);
        }
예제 #5
0
 public TicketDTO(ITicket ticket)
 {
     _ticket = new Ticket(ticket);
 }