Skip to content

Instantly share code, notes, and snippets.

@logicbomb
Created June 6, 2012 20:44
Show Gist options
  • Select an option

  • Save logicbomb/2884653 to your computer and use it in GitHub Desktop.

Select an option

Save logicbomb/2884653 to your computer and use it in GitHub Desktop.
[Category("Smoke Tests")]
[TestFixture]
public class CompositeSmokeTests : ILoggingSource
{
private Browser _browser;
private SmokeTestBootstrapper _bootstrapper;
[TestFixtureSetUp]
public void InitializeDatabase()
{
var connectionString = ConfigurationManager.ConnectionStrings["OrmLiteConnectionString"].ConnectionString;
Database.Initialize(connectionString);
}
[SetUp]
public void SetupFixture()
{
_bootstrapper = new SmokeTestBootstrapper("Lemur.StoreManager");
_browser = new Browser(_bootstrapper);
}
[Test]
public void Test()
{
var resp = _browser.Post("/login", with =>
{
with.FormValue("Email", "superadmin");
with.FormValue("Password", "Password");
with.Query("returnUrl", "/store/" + SmokeTestData.StoreId + "/notifications");
}).Then.Get("/store/" + SmokeTestData.StoreId + "/notifications");
var html = resp.Body.AsString();
Assert.AreEqual(HttpStatusCode.OK, resp.StatusCode);
this.WriteInfoMessage(html);
Assert.Less(html.IndexOf("Error Compiling Template:", StringComparison.Ordinal), 0);
Assert.Less(html.IndexOf("<title>500 means server error</title>", StringComparison.Ordinal), 0);
Assert.True(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment