예제 #1
0
        public void CanGetPartyById()
        {
            // Expected Result
            Party expected = fakePartyRepository._fakeRepository.First();
            // Actual Result
            PartyViewModel _vm    = _partyServices.GetPartyById(123456);
            Party          result = PartyViewModel.ToDataModel(_vm);

            // Assert
            expected.Should().BeEquivalentTo(result);
        }
예제 #2
0
        public void CanDeleteParty()
        {
            //Delete Party
            _partyServices.DeleteParty(123456);
            // Actual Result
            PartyViewModel _vm         = _partyServices.GetPartyById(123456);
            Party          resultParty = PartyViewModel.ToDataModel(_vm);
            bool           result      = resultParty.Dormant;

            // Assert
            result.Should().Equals(true);
        }
예제 #3
0
        public void CanAddParty()
        {
            //Create Additonal Party
            Party          expected  = fakePartyRepository.GenerateAdditionalParty();
            PartyViewModel _newParty = PartyViewModel.ToViewModel(expected);

            //Add Party
            _partyServices.AddParty(_newParty);
            // Actual Result
            PartyViewModel _vm    = _partyServices.GetPartyById(654321);
            Party          result = PartyViewModel.ToDataModel(_vm);

            // Assert
            expected.Should().BeEquivalentTo(result);
        }
예제 #4
0
        public void CanUpdateParty()
        {
            //Create Updated Party
            Party          updatedParty  = fakePartyRepository.GenerateUpdatedParty();
            PartyViewModel _updatedParty = PartyViewModel.ToViewModel(updatedParty);

            //Update Party
            _partyServices.UpdateParty(_updatedParty);
            // Expected Result
            Party expected = updatedParty;
            // Actual Result
            PartyViewModel _vm    = _partyServices.GetPartyById(123456);
            Party          result = PartyViewModel.ToDataModel(_vm);

            // Assert
            expected.Should().BeEquivalentTo(result);
        }
예제 #5
0
 public async Task UpdateParty(PartyViewModel party)
 {
     await _partyRepository.UpdateParty(PartyViewModel.ToDataModel(party));
 }
예제 #6
0
 public async Task AddParty(PartyViewModel party)
 {
     await _partyRepository.AddParty(PartyViewModel.ToDataModel(party));
 }