public void CreateLogContentWithNullValue_Error()
        {
            UserMessage message = new UserMessage
            {
                UserEventType = Infrastructure.Common.UserEventType.LoginSuccess
            };

            Assert.Throws<NullReferenceException>(() =>
                string.Format("User {0} has {1}", message.UserId, message.UserEventType));
        }
 public void RecordLoginAttempt(string email, bool success)
 {
     try
     {
         var user = GetUserByEmail(email);
         if (user == null)
             return;
         var message = new UserMessage
         {
             UserEventType = success ? UserEventType.LoginSuccess : UserEventType.LoginFailed,
             UserId = user.Id
         };
         _components.Bus.Publish(message);
     }
     catch (Exception ex)
     {
         Log.Error("RecordLoginAttempt", ex);
     }
 }