コード例 #1
0
        public void CalculateOutcome()
        {
            CheckForZeroOptions();
            DetermineVoteDistributionStrategy();

            _selectedVoteDistribution.DistributeVotes(this);
        }
コード例 #2
0
        public void CalculateOneSidedOutcome()
        {
            CheckForZeroOptions();
            _selectedVoteDistribution = new OneSidedVoteDistribution();

            _selectedVoteDistribution.DistributeVotes(this);
        }
コード例 #3
0
        public Survey CalculateOutcome(IVoteDistribution strategy)
        {
            if (!_options.Any())
            {
                throw new SurveyDomainException("Cannot calculate a survey with no options");
            }

            strategy.DistributeVotes(this);

            return(this);
        }