public HttpResponseMessage Post(MockLogin login)
        {
            if (MockError != null)
            {
                var response = Request.CreateResponse(MockError.StatusCode, MockError.Reason);
                MockError = null;
                return(response);
            }

            User user = Users.Login(login.UserName, login.Password);

            if (user == null)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, new MockErrorReason {
                    message = "We didn't recognize the username or password you entered. Please try again"
                }));
            }

            var authentication = new MockAuthentication
            {
                AccountAlias = user.AccountAlias,
                BearerToken  = Token
            };

            return(Request.CreateResponse(HttpStatusCode.OK, authentication));
        }
        public HttpResponseMessage Post(MockLogin login)
        {
            if (MockError != null)
            {
                var response = Request.CreateResponse(MockError.StatusCode, MockError.Reason);
                MockError = null;
                return response;
            }

            User user = Users.Login(login.UserName, login.Password);
            if (user == null)
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest, new MockErrorReason { message = "We didn't recognize the username or password you entered. Please try again" });
            }

            var authentication = new MockAuthentication
            {
                AccountAlias = user.AccountAlias,
                BearerToken = Token
            };

            return Request.CreateResponse(HttpStatusCode.OK, authentication);
        }