public void FilterOutrightsTournamentsWithCategoryTest()
        {
            TestLineSr LineSr = new TestLineSr();

            Kernel.Rebind <ILineSr>().ToConstant <ILineSr>(LineSr);

            ChangeTracker.Setup(x => x.SelectedSportFilter).Returns(new ComboBoxItemStringId("1", "0"));
            TournamentsViewModel model = new TournamentsViewModel(1l, new TournamentVw(1));


            var match = TestMatchLn.CreateMatch(1, false, true);

            var value = model.MatchFilter(match);

            Assert.IsTrue(value);

            model = new TournamentsViewModel(2l, new TournamentVw(1));

            match = TestMatchLn.CreateMatch(1, false, true);

            value = model.MatchFilter(match);

            Assert.IsFalse(value);
        }
Exemplo n.º 2
0
        public void OpenBasketTest()
        {
            AuthorizationService = MockRepository.GenerateStub <IAuthorizationService>();
            StationRepository    = MockRepository.GenerateStub <IStationRepository>();
            LanguageRepository   = MockRepository.GenerateStub <ILanguageRepository>();
            LineProvider         = MockRepository.GenerateStub <ILineProvider>();
            BusinessPropsHelper  = MockRepository.GenerateStub <IBusinessPropsHelper>();
            DataBinding          = MockRepository.GenerateStub <IDataBinding>();


            IoCContainer.Kernel.Bind <IDataBinding>().ToConstant <IDataBinding>(DataBinding).InSingletonScope();
            IoCContainer.Kernel.Bind <IAuthorizationService>().ToConstant <IAuthorizationService>(AuthorizationService).InSingletonScope();
            IoCContainer.Kernel.Bind <IStationRepository>().ToConstant <IStationRepository>(StationRepository).InSingletonScope();
            IoCContainer.Kernel.Bind <ILanguageRepository>().ToConstant <ILanguageRepository>(LanguageRepository).InSingletonScope();
            IoCContainer.Kernel.Bind <ILineProvider>().ToConstant <ILineProvider>(LineProvider).InSingletonScope();
            IoCContainer.Kernel.Bind <IBusinessPropsHelper>().ToConstant <IBusinessPropsHelper>(BusinessPropsHelper).InSingletonScope();


            DataBinding.Expect(x => x.TipListInfo).Return(new TipListInfo());



            Ticket ticket = new Ticket();

            ticket.Stake = 10;
            var matchVw = new TestMatchVw()
            {
                HomeCompetitorName   = "Home competitor",
                AwayCompetitorName   = "Away competitor",
                TournamentNameToShow = "tournament",
                IsEnabled            = true,
                LiveScore            = "0:0(1:1)",
                VisibleOddCount      = 120,
            };
            var match = new TestMatchLn()
            {
                MatchView = matchVw,
                MatchId   = 1
            };
            var betdomainVw = new TestBetDomainVw()
            {
                IsEnabled = true,
            };
            var betdomain = new TestBetDomain()
            {
                BetDomainId   = 1,
                Match         = match,
                BetDomainView = betdomainVw
            };
            var oddVw = new TestOddVw()
            {
                DisplayName = "sel 1",
                Value       = 100.21m
            };
            var testOdd = new TestOdd()
            {
                OutcomeId = 1,
                OddId     = { Value = 1 },
                BetDomain = betdomain,
                Value     = { Value = 1.85M },
                OddView   = oddVw,
            };
            var tipitem = new TestTipItem(testOdd)
            {
                IsEnabled      = true,
                BetDomainName  = "Total (2.5)",
                IsBankEnabled  = true,
                IsBank         = true,
                IsBankEditable = true,
            };
            var tipitem2 = new TestTipItem(testOdd)
            {
                IsEnabled     = false,
                BetDomainName = "Total (2.5)",
                IsChecked     = true,
            };

            ticket.TipItems.Add(tipitem);
            ticket.TipItems.Add(tipitem2);



            StationRepository.TurnOffCashInInit = true;
            StationRepository.Expect(x => x.AllowAnonymousBetting).Return(true);
            StationRepository.Expect(x => x.IsReady).Return(true);
            StationRepository.Expect(x => x.StationNumber).Return("0024");
            StationRepository.Expect(x => x.HubSettings).Return(new Dictionary <string, string>());
            StationRepository.Currency = "EUR";

            ChangeTracker                           = IoCContainer.Kernel.Get <IChangeTracker>();
            ChangeTracker.CurrentUser               = new AnonymousUser("1", 1);
            ChangeTracker.CurrentUser.Cashpool      = 100000;
            ChangeTracker.CurrentUser.AvailableCash = 100000;



            Dispatcher.Invoke(() =>
            {
                Window = MyRegionManager.FindWindowByViewModel <BasketViewModel>();
                Window.Show();
            });

            Thread.Sleep(1000);

            Dispatcher.Invoke(() =>
            {
                Window.Close();
            });
        }