Beispiel #1
0
        public static ITicketBuilder GetTicketBuilder(ISender sender = null, IEndCustomer endCustomer = null, int selectionCount = 0, int betCount = 0)
        {
            var tb = BuilderFactory.CreateTicketBuilder();

            tb.SetTicketId("ticket-" + SR.I1000P);
            if (sender != null)
            {
                tb.SetSender(sender);
            }
            if (endCustomer != null)
            {
                tb.SetSender(BuilderFactory.CreateSenderBuilder().SetBookmakerId(SR.I1000P).SetLimitId(SR.I100)
                             .SetCurrency("EUR").SetSenderChannel(SenderChannel.Internet).SetEndCustomer(endCustomer).Build());
            }

            for (var i = 0; i < betCount; i++)
            {
                var betBuilder = BuilderFactory.CreateBetBuilder();
                for (var j = 0; j < selectionCount; j++)
                {
                    betBuilder.AddSelection(BuilderFactory.CreateSelectionBuilder().SetEventId(SR.S1000P).SetIdLcoo(SR.I1000, 1, "", "1").SetOdds(SR.I1000P).SetBanker(SR.I100 > 90).Build());
                }

                var bet = betBuilder
                          .AddSelectedSystem(1)
                          .SetBetId("bet-id-" + SR.I1000)
                          .SetBetBonus(SR.I1000)
                          .SetStake(SR.I1000P, StakeType.Total)
                          .Build();
                tb.AddBet(bet);
                tb.SetTotalCombinations(tb.GetBets().Count());
            }
            return(tb);
        }
        public static void Init(TestContext context)
        {
            var configuration = new SdkConfigurationInternal(new SdkConfiguration("user", "pass", "host", "vhost", false, "sslServerName", 5, 12, 17, "GBP", SenderChannel.Mobile), null);

            _builderFactory = new BuilderFactoryHelper(configuration).BuilderFactory;
            _endCustomer    = _builderFactory.CreateEndCustomerBuilder().SetId("customerId").SetIp(IPAddress.Loopback).SetDeviceId("deviceId").SetLanguageId("si").Build();
        }
Beispiel #3
0
        public EndCustomer(IEndCustomer customer)
        {
            Guard.Argument(customer, nameof(customer)).NotNull();

            Id         = string.IsNullOrEmpty(customer.Id) ? null : customer.Id;
            Confidence = customer.Confidence > 0 ? customer.Confidence : (long?)null;
            DeviceId   = string.IsNullOrEmpty(customer.DeviceId) ? null : customer.DeviceId;
            Ip         = customer.Ip;
            LanguageId = string.IsNullOrEmpty(customer.LanguageId) ? null : customer.LanguageId;
        }
Beispiel #4
0
        public Sender(int bookmakerId, string currency, string terminalId, SenderChannel channel, string shopId, IEndCustomer endCustomer, int limitId)
        {
            Guard.Argument(bookmakerId, nameof(bookmakerId)).Positive();
            Guard.Argument(currency, nameof(currency)).NotNull().NotEmpty();
            Guard.Argument(currency.Length, nameof(currency.Length)).InRange(3, 4);
            Guard.Argument(terminalId, nameof(terminalId)).Require(string.IsNullOrEmpty(terminalId) || TicketHelper.ValidateUserId(terminalId));
            Guard.Argument(shopId, nameof(shopId)).Require(string.IsNullOrEmpty(shopId) || TicketHelper.ValidateUserId(shopId));
            Guard.Argument(limitId, nameof(limitId)).Positive();

            BookmakerId = bookmakerId;
            Currency    = currency.Length == 3 ? currency.ToUpper() : currency;
            TerminalId  = terminalId;
            Channel     = channel;
            ShopId      = shopId;
            EndCustomer = endCustomer;
            LimitId     = limitId;

            ValidateSenderData();
        }
 /// <summary>
 /// Set the identification of the end user (customer)
 /// </summary>
 /// <param name="ip">The ip address of the end customer</param>
 /// <param name="customerId">The customer id</param>
 /// <param name="languageId">The language id</param>
 /// <param name="deviceId">The device id</param>
 /// <param name="confidence">The confidence</param>
 /// <returns>Returns a <see cref="ISenderBuilder" /></returns>
 public ISenderBuilder SetEndCustomer(IPAddress ip, string customerId, string languageId, string deviceId, long confidence)
 {
     _customer = new EndCustomerBuilder().SetIp(ip).SetLanguageId(languageId).SetDeviceId(deviceId).SetId(customerId).SetConfidence(confidence).Build();
     return(this);
 }
 /// <summary>
 /// Set the identification of the end user (customer)
 /// </summary>
 /// <param name="customer">The end customer to be set</param>
 /// <returns>Returns a <see cref="ISenderBuilder" /></returns>
 public ISenderBuilder SetEndCustomer(IEndCustomer customer)
 {
     _customer = customer ?? throw new ArgumentException("Customer not valid.");
     return(this);
 }