Please note that I've already went through these answers: 1, 2.
those answers helped implementing a WebClientSimulator successfully (by the help of: WebClient interface example).
I need to test an automatic web page notification based on url and some parameters, But I don't know how to use the WebClientSimulator correctly:
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);
}
How do i verify that the web page was notified? with the given parameters?