It looks like you have a method that returns a browser instance: Fake.Browser()so why not just rewrite this to provide an authenticated version if necessary. Something like this is possible:
public static Browser Browser(string username = null, string password = null)
{
var browser = new Browser(new UnitTestBootstrapper());
if (username.IsEmpty() || password.IsEmpty()) return browser;
return browser.Post("/login", with =>
{
with.HttpRequest();
with.FormValue("Username", username);
with.FormValue("Password", password);
}).Then;
}
source
share