public void TestPostToTarget() { var m = new MockManosModule(); var req = new MockHttpRequest(HttpMethod.HTTP_POST, "/Foobar"); m.Post("/Foobar", new ManosAction(FakeAction)); Assert.AreEqual(new ManosAction(FakeAction), m.Routes.Find(req).Action); req = new MockHttpRequest(HttpMethod.HTTP_GET, "/Foobar"); Assert.IsNull(m.Routes.Find(req)); }
public void TestPostToModule() { var m = new MockManosModule(); var req = new MockHttpRequest(HttpMethod.HTTP_POST, "/FakeModule/FakeAction"); m.Post("/FakeModule", new FakeModule()); // // I guess technically this is testing the auto name registering too // Assert.AreEqual(new ManosAction(FakeModule.FakeAction), m.Routes.Find(req).Action); req = new MockHttpRequest(HttpMethod.HTTP_GET, "/FakeModule/FakeAction"); Assert.IsNull(m.Routes.Find(req)); }