Skip to content

Instantly share code, notes, and snippets.

@numa08
Created September 19, 2012 14:03
Show Gist options
  • Save numa08/3749857 to your computer and use it in GitHub Desktop.
Save numa08/3749857 to your computer and use it in GitHub Desktop.
AsyncAccessTest
[TestClass]
public class AsyncAccessTest : SilverlightTest
{
[TestMethod, Asynchronous]
public void Test_AsyncHTTPGET_Success()
{
var accesser = new AsyncAccess();
accesser
.requestHttpGET("http://www.google.co.jp").
ObserveOnTest(this).
Subscribe(content =>
{
Assert.IsNotNull(content);
TestComplete();
});
}
[TestMethod, Asynchronous]
public void Test_AsyncHTTPGET_InvalidURL()
{
var accesser = new AsyncAccess();
accesser
.requestHttpGET("http://localhost").
ObserveOnTest(this)
.Subscribe
(_ => Assert.Fail(),
e =>
{
Assert.IsNotNull(e);
TestComplete();
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment