public void CanGetElectionById()
        {
            // Expected Result
            Election expected = fakeElectionRepository._fakeRepository.First();
            // Actual Result
            ElectionViewModel _vm    = _electionServices.GetElectionById(123456);
            Election          result = ElectionViewModel.ToDataModel(_vm);

            // Assert
            expected.Should().BeEquivalentTo(result);
        }
        public void CanDeleteElection()
        {
            //Delete Election
            _electionServices.DeleteElection(123456);
            // Actual Result
            ElectionViewModel _vm            = _electionServices.GetElectionById(123456);
            Election          resultElection = ElectionViewModel.ToDataModel(_vm);
            bool result = resultElection.Dormant;

            // Assert
            result.Should().Equals(true);
        }
        public void CanAddElection()
        {
            //Create Additonal Election
            Election          expected     = fakeElectionRepository.GenerateAdditionalElection();
            ElectionViewModel _newElection = ElectionViewModel.ToViewModel(expected);

            //Add Election
            _electionServices.AddElection(_newElection);
            // Actual Result
            ElectionViewModel _vm    = _electionServices.GetElectionById(654321);
            Election          result = ElectionViewModel.ToDataModel(_vm);

            // Assert
            expected.Should().BeEquivalentTo(result);
        }
        public void CanUpdateElection()
        {
            //Create Updated Election
            Election          updatedElection  = fakeElectionRepository.GenerateUpdatedElection();
            ElectionViewModel _updatedElection = ElectionViewModel.ToViewModel(updatedElection);

            //Update Election
            _electionServices.UpdateElection(_updatedElection);
            // Expected Result
            Election expected = updatedElection;
            // Actual Result
            ElectionViewModel _vm    = _electionServices.GetElectionById(123456);
            Election          result = ElectionViewModel.ToDataModel(_vm);

            // Assert
            expected.Should().BeEquivalentTo(result);
        }
 public async Task UpdateElection(ElectionViewModel election)
 {
     await _electionRepository.UpdateElection(ElectionViewModel.ToDataModel(election));
 }