示例#1
0
        public void ParsTournamentMinusMultistringXml()
        {
            ConfigurationManager.AppSettings["CreateDatabase"] = "0";

            string sXmlString = "";

            DatabaseCache.EnsureDatabaseCache();
            BetDomainMap.EnsureInstance();
            using (var reader = new StreamReader("dc.xml"))
            {
                sXmlString = reader.ReadToEnd();
            }
            var srlc            = LineSerializeHelper.StringToObject <SportRadarLineContainer>(sXmlString);
            UpdateStatistics us = new UpdateStatistics();

            var fsr = LineSr.SyncRoutines(eUpdateType.PreMatches, string.Format("SportRadar Pre-Match Update. DataSyncCacheId = {0}", 0), false, us, delegate(object objParam)
            {
                return(ProviderHelper.MergeFromSportRadarLineContainer(srlc, 0));
            });

            Assert.AreEqual(fsr, eFileSyncResult.Succeeded);
            var instance = LineSr.Instance.AllObjects.Groups.Where(x => x.Value.SvrGroupId == 5263).First();

            Assert.AreEqual(8, instance.Value.Strings.Count);
            Assert.AreEqual("Pro A", instance.Value.GetDisplayName("EN"));
        }
        private static void ImportOutrightExample()
        {
            try
            {
                string sXml = TraceHelper.ReadTextFromFile("OutrightExample.xml");

                SportRadarLineContainer srlc = SportRadarLineContainer.FromXmlString(sXml);

                eFileSyncResult fsr = LineSr.SyncRoutines(eUpdateType.PreMatches, string.Format("SportRadar Pre-Match Update. DataSyncCacheId = {0}", 1), true, null, delegate(object objParam)
                {
                    return(ProviderHelper.MergeFromSportRadarLineContainer(srlc, 1));
                });
            }
            catch (Exception excp)
            {
            }
        }
示例#3
0
        public void ParseOutright()
        {
            ConfigurationManager.AppSettings["CreateDatabase"] = "0";

            string sXmlString = "";

            DatabaseCache.EnsureDatabaseCache();
            BetDomainMap.EnsureInstance();
            using (var reader = new StreamReader("groupsLanguages.xml"))
            {
                sXmlString = reader.ReadToEnd();
            }
            var srlc            = LineSerializeHelper.StringToObject <SportRadarLineContainer>(sXmlString);
            UpdateStatistics us = new UpdateStatistics();

            var fsr = LineSr.SyncRoutines(eUpdateType.PreMatches, string.Format("SportRadar Pre-Match Update. DataSyncCacheId = {0}", 0), false, us, delegate(object objParam)
            {
                return(ProviderHelper.MergeFromSportRadarLineContainer(srlc, 0));
            });

            Assert.AreEqual(fsr, eFileSyncResult.Succeeded);

            //matches
            using (var reader = new StreamReader("content.xml"))
            {
                sXmlString = reader.ReadToEnd();
            }
            srlc = LineSerializeHelper.StringToObject <SportRadarLineContainer>(sXmlString);
            us   = new UpdateStatistics();

            fsr = LineSr.SyncRoutines(eUpdateType.PreMatches, string.Format("SportRadar Pre-Match Update. DataSyncCacheId = {0}", 0), false, us, delegate(object objParam)
            {
                return(ProviderHelper.MergeFromSportRadarLineContainer(srlc, 0));
            });

            Assert.AreEqual(fsr, eFileSyncResult.Succeeded);
            var instance = LineSr.Instance.AllObjects.Matches.Where(x => x.Value.MatchId == 1004106).First();

            Assert.AreEqual("RHL - Podium1", instance.Value.GetOutrightDisplayName("EN"));
            Assert.AreEqual("RHL - Podium1", instance.Value.MatchView.Name);
        }