Exemplo n.º 1
0
        public async Task ItDoesNothing_WhenCredentialsNotSupplied(string username, string password)
        {
            // Act
            await _sut.LogIn(username, ToSecureString(password), CancellationToken.None);

            // Assert
            await _serviceClient.DidNotReceive().TryLogIn(Arg.Any <NetworkCredential>(), Arg.Any <CancellationToken>());

            _eventAggregator.DidNotReceive().PublishOnUIThread(Arg.Any <ApplicationEvent>());
        }
Exemplo n.º 2
0
        public void WorkNotifierCallsEventsInPairs_DefaultMessagesMatch()
        {
            var disposable = workNotifier.NotifyOfWork();

            eventAggregator.Received(1).PublishOnUIThread(Arg.Is <WorkStarted>(s => s.Message == new WorkStarted().Message));
            eventAggregator.DidNotReceive().PublishOnUIThread(Arg.Any <WorkFinished>());

            eventAggregator.ClearReceivedCalls();

            disposable.Dispose();

            eventAggregator.DidNotReceive().PublishOnUIThread(Arg.Any <WorkStarted>());
            eventAggregator.Received(1).PublishOnUIThread(Arg.Is <WorkFinished>(s => s.Message == new WorkFinished().Message));
        }