public Window ConnectToDataBase_LoadSomePLayers_ShowTheirStatistics_InTheLiveStats()
        {
            Func <string, IPlayerStatistics> get =
                playerName => _container
                .Resolve <IPlayerStatistics>()
                .InitializePlayer(playerName, PokerStars)
                .UpdateStatistics();

            const string salemorguy = "salemorguy";
            const string greystoke  = "Greystoke-11";

            // const string renniweg = "renniweg";
            var eventAggregator = new EventAggregator();

            var detailedPreFlopStatisticsViewModelMake =
                new Constructor <IDetailedPreFlopStatisticsViewModel>(() => _container.Resolve <DetailedPreFlopStatisticsViewModel>());
            var detailedPostFlopHeroActsStatisticsViewModelMake =
                new Constructor <IDetailedPostFlopHeroActsStatisticsViewModel>(
                    () => _container.Resolve <DetailedPostFlopHeroActsStatisticsViewModel>());

            var detailedPostFlopHeroReactsStatisticsViewModelMake =
                new Constructor <IDetailedPostFlopHeroReactsStatisticsViewModel>(
                    () => _container.Resolve <DetailedPostFlopHeroReactsStatisticsViewModel>());

            var detailedStatisticsAnalyzerViewModel =
                new DetailedStatisticsAnalyzerViewModel(
                    detailedPreFlopStatisticsViewModelMake,
                    detailedPostFlopHeroActsStatisticsViewModelMake,
                    detailedPostFlopHeroReactsStatisticsViewModelMake,
                    new Mock <IRepositoryHandBrowserViewModel>().Object);

            // TODO: Before this test will work again, we will have to specify the settings and dimensions mocks otherwise it will either
            // fail or have size 0, 0
            var tableStatisticsViewModel = new PokerTableStatisticsViewModel(
                new Mock <ISettings>().Object,
                new Mock <IDimensionsViewModel>().Object,
                new Constructor <IPlayerStatisticsViewModel>(() => _container.Resolve <IPlayerStatisticsViewModel>()),
                detailedStatisticsAnalyzerViewModel,
                new Mock <IActiveAnalyzablePlayersSelector>().Object,
                new Mock <IFilterPopupViewModel>().Object);
            var designWindow = new TableStatisticsDesignWindow(
                eventAggregator,
                _container.Resolve <IRepositoryHandBrowserViewModel>())
            {
                Topmost     = true,
                DataContext = tableStatisticsViewModel
            };

            tableStatisticsViewModel.UpdateWith(
                new[]
            {
                // get(renniweg),
                get(greystoke),
                get(salemorguy)
            });

            designWindow.ShowDialog();
            return(designWindow);
        }
Example #2
0
        public void TableStatisticsViewTemplate()
        {
            var designWindow = new TableStatisticsDesignWindow(new EventAggregator(), HandBrowserViewModelStub)
            {
                Topmost = true
            };

            designWindow.ShowDialog();
        }