public void can_log_failed_authentication()
        {
            var          providerId   = Guid.NewGuid();
            const string providerName = "TestProvider";
            const string ipAddress    = "127.0.0.1";
            var          provider     = new ExternalProvider(
                providerId,
                providerName,
                _command);

            provider.NotAuthenticatedInvalidCredentials(ipAddress);
            var events = provider.TakeEvents();

            Assert.Collection(
                events,
                e => Assert.IsType <ExternalProviderMsgs.ProviderCreated>(e),
                e =>
            {
                if (e is ExternalProviderMsgs.AuthenticationFailedInvalidCredentials failed)
                {
                    Assert.Equal(providerId, failed.ProviderId);
                    Assert.Equal(ipAddress, failed.HostIPAddress);
                }
                else
                {
                    throw new Exception("wrong event.");
                }
            });
        }