Ejemplo n.º 1
0
 protected string PostStringResultOrNull(string relativePath, NameValueCollection form)
 {
     using (var browser = new Browser())
     {
         browser.AppendHeader("Accept-Language", "en-GB,en");
         var result = browser.Post("/" + relativePath, form);
         if (result.StatusCode == 404 || result.ResponseText.Contains("The resource cannot be found")) return null;
         Assert.Equal(200, result.StatusCode);
         return result.ResponseText;
     }
 }