I am writing a unit test for a controller like this:
public HttpResponseMessage PostLogin(LoginModel model)
{
    if (!ModelState.IsValid)
        return new HttpResponseMessage(HttpStatusCode.BadRequest);
}
the model looks like:
public class LoginModel
{
    [Required]
    public string Username { set; get; }
    [Required]
    public string Password { set; get; }
}
Then I have unit test like this one:
[TestMethod]
public void TestLogin_InvalidModel()
{
    AccountController controller = CreateAccountController();
    ...
    var response = controller.PostLogin(new LoginModel() {  });
    Assert.AreEqual(HttpStatusCode.BadRequest, response.StatusCode);
}
Actually the ModelState is validated... which is weird for me as both fields are required... Could anybody advise?