Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added example on how to use the Set<T> extension method

  • Loading branch information...
commit 55d24253b69a8fe57096ee21dc24111a512b149a 1 parent eecb1c4
@tmont tmont authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 README.markdown
View
16 README.markdown
@@ -90,3 +90,19 @@ public void User_can_be_authenticated_with_convenience_method()
}
```
+You can also set any virtual property from one of the `Http*` classes, even those that aren't explicitly settable. e.g., for `HttpContext`:
+
+```c#
+var context = new FakeHttpContext();
+var uri = new Uri("http://www.google.com/");
+
+//set the UrlReferrer
+context.Set(ctx => ctx.UrlReferrer, uri);
+
+//get the UrlReferrer
+Console.WriteLine(context.UrlReferrer); //<http://www.google.com/>
+```
+
+This means no more `NotImplementedException`s in your tests.
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.