Пример #1
0
        public void FindByResource()
        {
            WebConfigurationMock.Current = WebConfigurationFactory.GetExecutionEngineUrlMapping();
            UrlMappingCollection mappings = UrlMappingConfiguration.Current.Mappings;

            UrlMappingEntry entry = mappings[0];

            Assert.AreSame(mappings[0], mappings.Find(entry.Resource), "Could not find {0}.", entry.Resource);

            entry = mappings[1];
            Assert.AreSame(mappings[1], mappings.Find(entry.Resource), "Could not find {0}.", entry.Resource);

            entry = mappings[2];
            Assert.AreSame(mappings[2], mappings.Find(entry.Resource), "Could not find {0}.", entry.Resource);

            Assert.IsNull(mappings.Find("~/unmapped.wxe"), "Found mapping for unmapped resource.");
        }
Пример #2
0
        public void FindByFunctionType()
        {
            WebConfigurationMock.Current = WebConfigurationFactory.GetExecutionEngineUrlMapping();
            UrlMappingCollection mappings = UrlMappingConfiguration.Current.Mappings;

            UrlMappingEntry entry = mappings[0];

            Assert.AreSame(mappings[0], mappings.Find(entry.FunctionType), "Could not find {0}.", entry.FunctionType.FullName);

            entry = mappings[1];
            Assert.AreSame(mappings[1], mappings.Find(entry.FunctionType), "Could not find {0}.", entry.FunctionType.FullName);

            entry = mappings[2];
            Assert.AreSame(mappings[0], mappings.Find(entry.FunctionType), "Could not find {0}.", entry.FunctionType.FullName);

            Assert.IsNull(mappings.Find(typeof(UnmappedFunction)), "Found mapping for unmapped function.");
        }