Exemplo n.º 1
0
        UpdateWith_ListOfPlayers_CallToPercentageCalculatorPassesHeroBStatisticsColumnCountAsGetColumnCountFunction(
            )
        {
            const int columnCount = 2;

            _heroBStatisticStub.SetupGet(s => s.MatchingPlayers)
            .Returns(new IList <IAnalyzablePokerPlayer> [columnCount]);

            var sut = new HeroCheckOrBetSetStatistics(
                _calculatorMock.Object,
                _statisticsStub,
                SomePlayer,
                SomeStreet,
                SomeInPosition);

            Expression <Func <Func <int, int>, bool> > getColumnCountsExpression =
                func => func(0) == columnCount;

            sut.UpdateWith(new[] { _playerStub.Object });

            _calculatorMock.Verify(
                pc => pc.CalculatePercentages(
                    It.IsAny <Func <int> >(),
                    It.Is(getColumnCountsExpression),
                    It.IsAny <Func <int, int, int> >(),
                    It.IsAny <Action <int, int, int> >()));
        }
Exemplo n.º 2
0
        public void UpdateWith_ListOfPlayers_CallToPercentageCalculatorPassesOneAsGetRowCountFunction()
        {
            var sut = new HeroCheckOrBetSetStatistics(
                _calculatorMock.Object,
                _statisticsStub,
                SomePlayer,
                SomeStreet,
                SomeInPosition);

            Expression <Func <Func <int>, bool> > getRowCountsExpression = func => func() == 1;

            sut.UpdateWith(new[] { _playerStub.Object });

            _calculatorMock.Verify(
                pc => pc.CalculatePercentages(
                    It.Is(getRowCountsExpression),
                    It.IsAny <Func <int, int> >(),
                    It.IsAny <Func <int, int, int> >(),
                    It.IsAny <Action <int, int, int> >()));
        }