示例#1
0
        public static IMatchVw CreateMatch(long id, bool isLiveBet = false, bool isOutright = false)
        {
            var match = new TestMatchVw()
            {
                LineObject = new MatchLn()
                {
                    BtrMatchId = id
                },
                SportView             = TestGroupVw.CreateGroup(id, true),
                CategoryView          = TestGroupVw.CreateGroup(id, false),
                TournamentView        = TestGroupVw.CreateGroup(id, false),
                VisibleBetDomainCount = 10,
                AllVisibleOddCount    = 10,
                IsOutright            = isOutright,
                IsLiveBet             = isLiveBet,
                IsEnabled             = true,
                Name            = "Test",
                StartDate       = DateTime.Now,
                Visibility      = Visibility.Visible,
                SportDescriptor = id.ToString(),
            };

            if (!isLiveBet)
            {
                match.StartDate = DateTime.Now.AddDays(1);
            }
            match.TournamentView = TestGroupVw.CreateGroup(id, false);
            return(match);
        }
        public void FilterOutrights()
        {
            MyRegionManager.Setup(x => x.NavigatBack(RegionNames.ContentRegion)).Returns(null);
            var match = TestMatchVw.CreateMatch(1, false, false) as TestMatchVw;

            match.ExpiryDate = DateTime.Now.AddMinutes(-5);
            ChangeTracker.Setup(x => x.CurrentMatch).Returns(match);
            var model = new BetDomainsViewModel();

            for (int i = 0; i < 5000; i++)
            {
                Thread.Sleep(1);
            }

            MyRegionManager.Verify(x => x.NavigatBack(RegionNames.ContentRegion), Times.Once);;
        }
示例#3
0
        public static IMatchLn CreateMatch(long id, bool livebet, bool isOutright = false)
        {
            var match = new TestMatchLn()
            {
                MatchId       = id,
                BtrMatchId    = id,
                Active        = { Value = true },
                IsLiveBet     = { Value = livebet },
                StartDate     = { Value = new DateTimeSr(DateTime.Now.AddHours(3)) },
                ExpiryDate    = { Value = new DateTimeSr(DateTime.Now.AddHours(3)) },
                outright_type = isOutright ? eOutrightType.Outright : eOutrightType.None,
            };

            match.MatchView = TestMatchVw.CreateMatch(id, livebet, isOutright);
            //match.ParentGroups.Add(TestGroupLn.CreateGroup(GroupLn.GROUP_TYPE_SPORT));
            //match.BetDomains = new BetDomainList(match);

            return(match);
        }