public void Test1()
        {
            IVotingCalculator calculator = new FPVotingCalculator(_repository);
            ElectionResult    result     = calculator.CalculateElectionResult(1);

            Assert.NotNull(result);
        }
        public IActionResult ElectionResult(int id)
        {
            // Get the Position details
            Position position = _repository.GetPosition(id);

            // Calculate the election results
            IVotingCalculator calculator;

            switch (position.Election.VotingMethod)
            {
            case VotingMethod.FullPreferential:
                calculator = new FPVotingCalculator(_repository);
                break;

            case VotingMethod.OptionalPreferential:
                calculator = new OPVotingCalculator(_repository);
                break;

            default:     // VotingMethod.FirstPastThePost:
                calculator = new FPTPVotingCalculator(_repository);
                break;
            }

            return(View(calculator.CalculateElectionResult(id)));
        }