Example #1
0
        public async Task SendReloadClientSearchMessageWhenClientWasAddedSuccessfully()
        {
            // Arrange
            Mock <ClientEditViewModel> mockClientEditViewModel = this.GetMockedViewModel();

            mockClientEditViewModel.Setup(x => x.SaveOrUpdateClientAsync()).Returns(Task.FromResult(true));

            NotificationMessage notificationMessage = null;

            Messenger.Default.Register <NotificationMessage>(this, x => notificationMessage = x);

            ClientCreationState clientCreationState = this.GetDefaultState(mockClientEditViewModel);

            // Act
            await clientCreationState.Commit();

            // Assert
            notificationMessage.Should().NotBeNull();
            notificationMessage.Notification.Should().Be(Resources.Message_ReloadClientsForClientSearchVM);
        }