I'm trying to unit test a piece of code that needs a currently logged in user in the test. Using the .Net 2.0 Membership Provider, how can I programmatically log in as a user for this test?
if(Membership.ValidateUser("user1",P@ssw0rd))
{
FormsAuthentication.SetAuthCookie("user1",true);
}