internal static IProductInfo GetProductInfo(int subItemCount = 0)
        {
            if (subItemCount < 1)
            {
                subItemCount = SR.I(20);
            }
            var pil = new List <productInfoLink>();
            var sc  = new List <streamingChannel>();

            while (subItemCount > 0)
            {
                subItemCount--;
                pil.Add(GetProductInfoLinkApi());
                sc.Add(GetStreamingChannelApi());
            }
            return(new ProductInfo(new ProductInfoDTO(new productInfo()
            {
                is_auto_traded = new productInfoItem(),
                is_in_hosted_statistics = new productInfoItem(),
                is_in_live_center_soccer = new productInfoItem(),
                is_in_live_match_tracker = new productInfoItem(),
                is_in_live_score = new productInfoItem(),
                links = pil.ToArray(),
                streaming = sc.ToArray()
            })));
        }
        public static desc_market GetDescMarket(desc_market baseMsg)
        {
            var newMsg = new desc_market
            {
                id          = baseMsg.id,
                name        = "Market " + SR.S1000,
                description = "Description " + SR.S1000,
                variant     = baseMsg.variant,
                mappings    = new mappingsMapping[baseMsg.mappings.Length],
                outcomes    = new desc_outcomesOutcome[baseMsg.outcomes.Length],
                specifiers  = new desc_specifiersSpecifier[baseMsg.specifiers.Length]
            };

            baseMsg.mappings.CopyTo(newMsg.mappings, 0);
            baseMsg.outcomes.CopyTo(newMsg.outcomes, 0);
            baseMsg.specifiers.CopyTo(newMsg.specifiers, 0);
            foreach (var m in newMsg.outcomes)
            {
                m.name        = "Outcome " + SR.S();
                m.description = "Desc " + SR.S();
            }
            foreach (var m in newMsg.specifiers)
            {
                m.name        = "Specifier name " + SR.S();
                m.description = "Desc " + SR.S();
            }
            return(newMsg);
        }
        public static mappingsMapping GetMappingsMapping(int id = 0, int subItemCount = 0)
        {
            if (subItemCount == 0)
            {
                subItemCount = SR.I(20);
            }

            var outcomes = new List <mappingsMappingMapping_outcome>();

            for (var j = 0; j < subItemCount; j++)
            {
                outcomes.Add(GetMappingsMappingMappingOutcome());
            }
            var producerId = SR.I(10);

            return(new mappingsMapping
            {
                market_id = id == 0 ? SR.S1000 : id.ToString(),
                product_id = producerId,
                product_ids = $"{producerId}|{producerId+1}",
                sport_id = SR.Urn("sport", SR.I100).ToString(),
                sov_template = SR.S1000,
                valid_for = "setnr=" + SR.I100,
                mapping_outcome = SR.I100 > 50 ? null : outcomes.ToArray()
            });
        }
        public static teamCompetitor GetTeamCompetitor(int id = 0)
        {
            var references = new List <competitorReferenceIdsReference_id>();

            for (var j = 0; j < 5; j++)
            {
                var rc = GetReferenceCompetitor();
                if (references.Find(i => i.name == rc.name) == null)
                {
                    references.Add(rc);
                }
            }

            return(new teamCompetitor
            {
                id = id == 0 ? SR.Urn("competitor", 100000).ToString() : SR.Urn(id, "competitor").ToString(),
                name = "Competitor " + SR.S1000,
                abbreviation = SR.S1000,
                @virtual = true,
                country = SR.S1000,
                virtualSpecified = true,
                qualifier = SR.S1000,
                country_code = SR.S1000,
                reference_ids = references.ToArray(),
                divisionSpecified = true,
                division = SR.I100,
                state = "PA"
            });
        }
        public static competitorProfileEndpoint GetCompetitorProfileEndpoint(int id = 0, int playerCount = 0, IDictionary <string, string> referenceIds = null)
        {
            if (playerCount == 0)
            {
                playerCount = SR.I(20);
            }

            var players = new List <playerExtended>();

            for (var j = 0; j < playerCount; j++)
            {
                players.Add(GetPlayerExtended());
            }

            return(new competitorProfileEndpoint
            {
                competitor = new teamExtended
                {
                    id = id == 0 ? SR.Urn("competitor", 100000).ToString() : SR.Urn(id, "competitor").ToString(),
                    name = "my name",
                    abbreviation = SR.S1000,
                    @virtual = true,
                    virtualSpecified = true,
                    country = SR.S1000,
                    state = "PA",
                    reference_ids = referenceIds?.Select(s => new competitorReferenceIdsReference_id {
                        name = s.Key, value = s.Value
                    }).ToArray()
                },
                generated_at = DateTime.Today,
                generated_atSpecified = true,
                players = players.ToArray()
            });
        }
        public static desc_market GetDescMarket(int id = 0, int subItemCount = 0)
        {
            if (subItemCount == 0)
            {
                subItemCount = SR.I(20);
            }

            var mappings   = new List <mappingsMapping>();
            var outcomes   = new List <desc_outcomesOutcome>();
            var specifiers = new List <desc_specifiersSpecifier>();

            for (var i = 0; i < subItemCount; i++)
            {
                mappings.Add(GetMappingsMapping());
                outcomes.Add(GetDescOutcomesOutcome());
                specifiers.Add(GetDescSpecifiersSpecifier());
            }

            var msg = new desc_market
            {
                id          = id == 0 ? SR.I1000 : id,
                name        = "Market " + SR.S1000,
                description = "Description " + SR.S1000,
                variant     = "Variant " + SR.S1000,
                mappings    = mappings.ToArray(),
                outcomes    = outcomes.ToArray(),
                specifiers  = specifiers.ToArray()
            };

            return(msg);
        }
        public static tournamentInfoEndpoint GeTournamentInfoEndpoint(int id = 0, int subItemCount = 0)
        {
            if (subItemCount == 0)
            {
                subItemCount = SR.I(20);
            }

            var groups = new List <tournamentGroup>();

            for (var j = 0; j < subItemCount; j++)
            {
                groups.Add(GetTournamentGroup());
            }

            var msg = new tournamentInfoEndpoint
            {
                tournament            = GetTournamentExtendedList(10).First(),
                competitors           = GetTournamentExtendedList(10).First().competitors,
                generated_at          = DateTime.Today,
                generated_atSpecified = true,
                groups = groups.ToArray(),
                round  = GetMatchRound(),
                season = GetSeasonExtended(),
                season_coverage_info = GetSeasonCoverageInfo()
            };

            return(msg);
        }
 public static category GetCategory(int id = 0)
 {
     return(new category
     {
         id = id == 0 ? SR.Urn("category").ToString() : SR.Urn(id, "category").ToString(),
         name = $"Category name {SR.S1000}"
     });
 }
 public static currentSeason GetCurrentSeason(int id = 0)
 {
     return(new currentSeason
     {
         id = id == 0 ? SR.Urn("season", 100000).ToString() : SR.Urn(id, "season").ToString(),
         name = $"Season name {SR.S1000}"
     });
 }
 public static IAssist GetAssist(int id = 0)
 {
     return(new Assist(
                SR.Urn(id == 0 ? SR.I1000 : id),
                new Dictionary <CultureInfo, string> {
         { new CultureInfo("en"), "Assist name" }
     }, "assist type"));
 }
 public static sport GetSport(int id = 0)
 {
     return(new sport
     {
         id = id == 0 ? SR.Urn("sport", 100).ToString() : SR.Urn(id, "sport").ToString(),
         name = $"Sport {SR.S1000}",
     });
 }
 public static desc_specifiersSpecifier GetDescSpecifiersSpecifier()
 {
     return(new desc_specifiersSpecifier
     {
         type = "Type " + SR.S100,
         name = "Name " + SR.S(),
         description = "Description " + SR.S1000
     });
 }
 public static desc_outcomesOutcome GetDescOutcomesOutcome(int id = 0)
 {
     return(new desc_outcomesOutcome
     {
         id = id == 0 ? SR.Urn("market").ToString() : SR.Urn(id, "market").ToString(),
         name = "Name " + SR.S(),
         description = "Description " + SR.S1000
     });
 }
 public static referee GetReferee(int id = 0)
 {
     return(new referee
     {
         id = id == 0 ? SR.Urn("player").ToString() : SR.Urn(id, "player").ToString(),
         name = "Name " + SR.S1000,
         nationality = "Nationality " + SR.S100,
     });
 }
        public static List <URN> GetUrns(int count, string type)
        {
            var items = new List <URN>();

            for (int i = 0; i < count; i++)
            {
                items.Add(SR.Urn(type));
            }
            return(items);
        }
 public static IPlayer GetPlayer(int id = 0)
 {
     return(new Player(
                id == 0
             ? SR.Urn("", 10000)
             : SR.Urn(id),
                new Dictionary <CultureInfo, string> {
         { new CultureInfo("en"), "Player " + SR.I1000 }
     }));
 }
        public static fixture GetFixture(int id = 0, int subItemCount = 0)
        {
            if (subItemCount == 0)
            {
                subItemCount = SR.I(10);
            }

            var infos = new List <info>();

            for (var j = 0; j < subItemCount; j++)
            {
                var info = GetInfo();
                if (infos.Find(i => i.key == info.key) == null)
                {
                    infos.Add(info);
                }
            }

            var references = new List <referenceIdsReference_id>();

            for (var j = 0; j < subItemCount; j++)
            {
                var rc = GetReference();
                if (references.Find(i => i.name == rc.name) == null)
                {
                    references.Add(rc);
                }
            }

            var msg = new fixture
            {
                id                      = id == 0 ? SR.Urn("match", 10000).ToString() : SR.Urn(id, "match").ToString(),
                name                    = "Fixture " + SR.S1000,
                competitors             = GetTeamCompetitorList(subItemCount).ToArray(),
                coverage_info           = GetCoverageInfo(),
                delayed_info            = GetDelayedInfo(),
                extra_info              = infos.ToArray(),
                liveodds                = SR.S1000,
                next_live_time          = DateTime.Today.ToString(SdkInfo.ISO8601_24H_FullFormat, CultureInfo.InvariantCulture), // should be like "2020-08-18T10:30:00+00:00"
                start_time_tbdSpecified = true,
                start_time_tbd          = true,
                start_timeSpecified     = true,
                start_time              = DateTime.Today,
                scheduledSpecified      = true,
                scheduled               = DateTime.Today.AddDays(3),
                scheduled_endSpecified  = true,
                scheduled_end           = DateTime.Today.AddDays(4),
                reference_ids           = references.ToArray(),
                replaced_by             = SR.I100 < 70 ? $"sr:match:{SR.I1000}" : null,
                status                  = SR.S10000P
            };

            return(msg);
        }
 public static seasonExtended GetSeasonExtended(int id = 0)
 {
     return(new seasonExtended
     {
         id = id == 0 ? SR.Urn("season", 10000).ToString() : SR.Urn(id, "season").ToString(),
         name = "Season " + SR.S1000,
         end_date = DateTime.Now.AddDays(SR.I100),
         start_date = DateTime.Now,
         tournament_id = SR.Urn("tournament", SR.I100).ToString(),
         year = DateTime.Now.Year.ToString()
     });
 }
 public static tournamentGroup GetTournamentGroup(int subItemCount = 0)
 {
     if (subItemCount == 0)
     {
         subItemCount = SR.I(20);
     }
     return(new tournamentGroup
     {
         name = "Group " + SR.S1000,
         competitor = GetTeamList(subItemCount).ToArray()
     });
 }
Exemplo n.º 20
0
 public static teamExtended GetTeamExtended(int id = 0)
 {
     return(new teamExtended
     {
         id = id == 0 ? SR.Urn("competitor", 1000).ToString() : SR.Urn(id, "competitor").ToString(),
         name = "Team " + SR.I1000,
         abbreviation = SR.S1000,
         @virtual = true,
         virtualSpecified = true,
         country = SR.S1000
     });
 }
Exemplo n.º 21
0
 public static team GetTeam(int id = 0)
 {
     return(new team
     {
         id = id == 0 ? SR.Urn("team", 100000).ToString() : SR.Urn(id, "team").ToString(),
         name = "Team " + SR.I1000,
         abbreviation = SR.S1000,
         @virtual = true,
         virtualSpecified = true,
         country = SR.S1000
     });
 }
 public static bet_settlement GetBetSettlement(IProducer producer, int eventId, long requestId)
 {
     return(new bet_settlement
     {
         product = producer.Id,
         timestamp = GetTimestamp(),
         EventURN = SR.Urn(eventId, "match"),
         event_id = SR.Urn(eventId, "match").ToString(),
         request_id = requestId,
         request_idSpecified = requestId > 0
                               // missing
     });
 }
 public static fixture_change GetFixtureChange(IProducer producer, int eventId, long requestId)
 {
     return(new fixture_change
     {
         product = producer.Id,
         timestamp = GetTimestamp(),
         EventURN = SR.Urn(eventId, "match"),
         event_id = SR.Urn(eventId, "match").ToString(),
         request_id = requestId,
         request_idSpecified = requestId > 0
                               // missing
     });
 }
 public static odds_change GetOddsChange(IProducer producer, int sportId, int eventId, long requestId)
 {
     return(new odds_change()
     {
         product = producer.Id,
         timestamp = GetTimestamp(),
         SportId = sportId == 0 ? SR.Urn("sport") : SR.Urn(sportId, "sport"),
         EventURN = SR.Urn(eventId, "match"),
         event_id = SR.Urn(eventId, "match").ToString(),
         request_id = requestId,
         request_idSpecified = requestId > 0
     });
 }
 public static seasonCoverageInfo GetSeasonCoverageInfo(int id = 0)
 {
     return(new seasonCoverageInfo
     {
         season_id = id == 0 ? SR.Urn("season", 10000).ToString() : SR.Urn(id, "season").ToString(),
         max_coverage_level = $"{SR.S1000}",
         max_covered = SR.I1000,
         scheduled = SR.I1000,
         max_coveredSpecified = true,
         min_coverage_level = SR.S1000,
         played = SR.I1000
     });
 }
 public static rollback_bet_cancel GetRollbackBetCancel(IProducer producer, int eventId, long requestId)
 {
     return(new rollback_bet_cancel
     {
         product = producer.Id,
         timestamp = GetTimestamp(),
         EventURN = SR.Urn(eventId, "match"),
         event_id = SR.Urn(eventId, "match").ToString(),
         request_id = requestId,
         request_idSpecified = requestId > 0
                               // missing
     });
 }
 public static bet_cancel GetBetCancel(IProducer producer, int eventId, long requestId)
 {
     return(new bet_cancel
     {
         product = producer.Id,
         timestamp = GetTimestamp(),
         EventURN = SR.Urn(eventId, "match"),
         event_id = SR.Urn(eventId, "match").ToString(),
         request_id = requestId,
         request_idSpecified = requestId > 0,
         market = GetMarkets(SR.I100).ToArray()
                  // missing
     });
 }
        internal static CoverageInfo GetCoverageInfo(int subItemCount = 0)
        {
            if (subItemCount < 1)
            {
                subItemCount = SR.I(20);
            }
            var items = new List <string>();

            for (var j = 0; j < subItemCount; j++)
            {
                items.Add(SR.S1000);
            }
            return(new CoverageInfo(SR.S100, true, new List <string> (items), CoveredFrom.Tv));
        }
 public static tournament GetTournament(int id = 0)
 {
     return(new tournament
     {
         id = id == 0 ? SR.Urn("tournament").ToString() : SR.Urn(id, "tournament").ToString(),
         name = "Tournament name " + SR.S100,
         scheduled = DateTime.Now,
         scheduledSpecified = true,
         scheduled_end = DateTime.Today,
         scheduled_endSpecified = true,
         category = GetCategory(),
         sport = GetSport()
     });
 }
        public static ISport GetSport(int id = 0, int subItemCount = 0)
        {
            if (subItemCount < 1)
            {
                subItemCount = SR.I(20);
            }
            var c = new List <ICategory>();

            while (subItemCount > 0)
            {
                subItemCount--;
                c.Add(GetCategory());
            }
            return(new Sport(SR.Urn(id == 0 ? SR.I1000 : id, "sport"), GetNames(null), c));
        }