Don't assume a specific charset in HTTP response from a server. Google
changes response charset based on the country of the client's
IP. There's no point in checking for the specific charset, it's enough
to check whether the response header has correct format.
Assert.AreEqual ("OK", res.StatusCode.ToString (), "#B1");
Assert.AreEqual ("OK", res.StatusDescription, "#B2");
- Assert.AreEqual ("text/html; charset=ISO-8859-1", res.Headers.Get ("Content-Type"), "#C1");
+ Assert.IsTrue (res.Headers.Get ("Content-Type").StartsWith ("text/html; charset=", StringComparison.OrdinalIgnoreCase), "#C1");
Assert.IsNotNull (res.LastModified, "#C2");
Assert.AreEqual (0, res.Cookies.Count, "#C3");