Пример #1
0
        public IHandHistoriesViewModel InitializeWith(
            IEnumerable <IConvertedPokerHand> convertedPokerHands, int itemsPerPage)
        {
            var handHistoryViewModels = new List <IHandHistoryViewModel>();

            if (string.IsNullOrEmpty(_handHistoriesFilter.HeroName) && convertedPokerHands.Count() > 0 &&
                !string.IsNullOrEmpty(convertedPokerHands.First().HeroName))
            {
                _handHistoriesFilter.HeroName = convertedPokerHands.First().HeroName;
            }

            foreach (IConvertedPokerHand hand in convertedPokerHands)
            {
                IHandHistoryViewModel handHistoryViewModel = _handHistoryViewModelMake.New;

                handHistoryViewModel
                .InitializeWith(_handHistoriesFilter.ShowPreflopFolds)
                .UpdateWith(hand);

                handHistoryViewModels.Add(handHistoryViewModel);
            }

            _itemsPagesManager.InitializeWith((uint)itemsPerPage, handHistoryViewModels);

            ConnectToHandHistoryFilterEvents();

            UpdatePageInfo();

            return(this);
        }
Пример #2
0
        public void CanNavigateBackward_EmptyList_ReturnsFalse()
        {
            const uint  itemsPerPage = 1;
            IList <int> allItems     = new List <int>();

            _manager
            .InitializeWith(itemsPerPage, allItems);

            Assert.That(_manager.CanNavigateBackward, Is.False);
        }