Doing a simple test to verify the view name for a controllers action:
var controller = new UserController();
var result = controller.Login() as ViewResult;
Assert.AreEqual("Login", result.ViewName);
The result.ViewName is coming back with “”, why would this be?
Are you specifying the view name in the controller Login method or are you leaving it at the default value (which is “”)?
If you leaving it at the default value, which is common, you need to test for String.Empty instead of “Login”.