public async Task SendUpdateBillValuesMessageWhenBillWasSavedSuccessfully() { // Arrange Mock <BillEditViewModel> mockBillEditViewModel = this.GetDefaultMockBillEditViewModel(); mockBillEditViewModel.Setup(x => x.SaveOrUpdateBillAsync()).Returns(Task.FromResult(true)); BillEditState billEditState = this.GetDefaultBillEditState(mockBillEditViewModel); // Act await billEditState.Commit(); // Assert mockBillEditViewModel.Verify(x => x.SendUpdateBillValuesMessage(), Times.Once); }
public async Task DoNotChangeToBillLoadedStateWhenBillWasNotSavedSuccessfully() { // Arrange Mock <BillEditViewModel> mockBillEditViewModel = this.GetDefaultMockBillEditViewModel(); mockBillEditViewModel.Setup(x => x.SaveOrUpdateBillAsync()).Returns(Task.FromResult(false)); BillEditState billEditState = this.GetDefaultBillEditState(mockBillEditViewModel); // Act await billEditState.Commit(); // Assert mockBillEditViewModel.Verify(x => x.ChangeToLoadedMode(null), Times.Never); }