Esempio n. 1
0
        public void ExecutionRequestShouldBeValidForValidUrls()
        {
            string          url  = "http://blah.com/get/TestBam/GetPages.json";
            RequestWrapper  reqW = new RequestWrapper(new { Headers = new NameValueCollection(), Url = new Uri(url), HttpMethod = "GET", ContentLength = 0, QueryString = new NameValueCollection() });
            ResponseWrapper resW = new ResponseWrapper(new object());

            ExecutionRequest req = new ExecutionRequest(reqW, resW);

            req.ServiceProvider.Set <TestBam>(new TestBam());
            req.RequestUrl = new Uri(url);
            req.ResolveExecutionTargetInfo();

            ValidationResult result = req.Validate();

            Expect.IsTrue(result.Success);
            Expect.AreEqual("TestBam", req.ClassName);
            Expect.AreEqual("GetPages", req.MethodName);
            Expect.AreEqual("json", req.Ext);
        }