Beispiel #1
0
        public void TestGetToTarget()
        {
            var m   = new MockManosModule();
            var req = new MockHttpRequest(HttpMethod.HTTP_GET, "/Foobar");

            m.Get("/Foobar", new ManosAction(FakeAction));
            Assert.AreEqual(new ManosAction(FakeAction), m.Routes.Find(req).Action);

            req = new MockHttpRequest(HttpMethod.HTTP_POST, "/Foobar");
            Assert.IsNull(m.Routes.Find(req));
        }
Beispiel #2
0
        public void TestGetToModule()
        {
            var m   = new MockManosModule();
            var req = new MockHttpRequest(HttpMethod.HTTP_GET, "/FakeModule/FakeAction");

            m.Get("/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_POST, "/FakeModule/FakeAction");
            Assert.IsNull(m.Routes.Find(req));
        }
Beispiel #3
0
        public void TestGetToTarget()
        {
            var m = new MockManosModule();
            var req = new MockHttpRequest(HttpMethod.HTTP_GET, "/Foobar");

            m.Get("/Foobar", new ManosAction(FakeAction));
            Assert.AreEqual(new ManosAction(FakeAction), m.Routes.Find(req).Action);

            req = new MockHttpRequest(HttpMethod.HTTP_POST, "/Foobar");
            Assert.IsNull(m.Routes.Find(req));
        }
Beispiel #4
0
        public void TestGetToModule()
        {
            var m = new MockManosModule();
            var req = new MockHttpRequest(HttpMethod.HTTP_GET, "/FakeModule/FakeAction");

            m.Get("/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_POST, "/FakeModule/FakeAction");
            Assert.IsNull(m.Routes.Find(req));
        }