public void CalculateOutcome() { CheckForZeroOptions(); DetermineVoteDistributionStrategy(); _selectedVoteDistribution.DistributeVotes(this); }
public void CalculateOneSidedOutcome() { CheckForZeroOptions(); _selectedVoteDistribution = new OneSidedVoteDistribution(); _selectedVoteDistribution.DistributeVotes(this); }
public Survey CalculateOutcome(IVoteDistribution strategy) { if (!_options.Any()) { throw new SurveyDomainException("Cannot calculate a survey with no options"); } strategy.DistributeVotes(this); return(this); }