Exemple #1
0
        private ShimPage GetMockOfPage(string browser)
        {
            var shimPage                    = new ShimPage();
            var shimHttpRequest             = new ShimHttpRequest();
            var shimHttpBrowserCapabilities = new ShimHttpBrowserCapabilities();

            ShimHttpCapabilitiesBase.AllInstances.BrowserGet = (obj) => browser;
            ShimHttpRequest.AllInstances.BrowserGet          = (obj) => shimHttpBrowserCapabilities.Instance;
            ShimPage.AllInstances.RequestGet      = (obj) => shimHttpRequest.Instance;
            ShimPage.AllInstances.ClientScriptGet = (obj) => new ShimClientScriptManager().Instance;
            ShimClientScriptManager.AllInstances.GetWebResourceUrlTypeString = (obj, type, url) => DummyString;
            return(shimPage);
        }
Exemple #2
0
        private ShimPage GetMockOfPage(string browser)
        {
            var shimPage                    = new ShimPage();
            var shimHttpRequest             = new ShimHttpRequest();
            var shimHttpBrowserCapabilities = new ShimHttpBrowserCapabilities();

            ShimHttpCapabilitiesBase.AllInstances.BrowserGet = (obj) => browser;
            ShimHttpRequest.AllInstances.BrowserGet          = (obj) => shimHttpBrowserCapabilities.Instance;
            ShimPage.AllInstances.RequestGet      = (obj) => shimHttpRequest.Instance;
            ShimPage.AllInstances.ClientScriptGet = (obj) => new ShimClientScriptManager().Instance;
            ShimClientScriptManager.AllInstances.GetWebResourceUrlTypeString = (obj, type, url) => DummyString;
            ShimHttpRequest.AllInstances.ParamsGet = (obj) =>
            {
                var collection = new NameValueCollection();
                collection.Add("__EVENTARGUMENT", "DELETEFILE:");
                return(collection);
            };
            ShimNameObjectCollectionBase.AllInstances.CountGet = (obj) => 1;
            ShimHttpRequest.AllInstances.FilesGet     = (obj) => new ShimHttpFileCollection();
            ShimPage.AllInstances.TraceGet            = (obj) => new TraceContext(new ShimHttpContext());
            ShimTraceContext.AllInstances.WriteString = (obj, str) => { };
            return(shimPage);
        }