这些答案有助于成功实施 WebClientSimulator (借助:WebClient interface example)。
我需要根据网址和一些参数测试自动网页通知,但我不知道如何正确使用WebClientSimulator:
public void NotifyWebPage(string url, NameValueCollection parameters)
{
using (WebClient client = new WebClient())
{
client.UploadValuesAsync(new Uri(url), parameters);
}
}
[TestMethod]
public void Validate_My_NotifyWebPage()
{
string url = "https://www.someurl.com/";
NameValueCollection parameters = new NameValueCollection();
NotifyWebPage(url, parameters);
}
如何验证网页是否已通知?用给定的参数?