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); }
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); }
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); }
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); }
public async Task UpdateParty(PartyViewModel party) { await _partyRepository.UpdateParty(PartyViewModel.ToDataModel(party)); }
public async Task AddParty(PartyViewModel party) { await _partyRepository.AddParty(PartyViewModel.ToDataModel(party)); }