Inheritance: ConfigurationBase
        public void IsMapped_HttpHeaderIsEqualToValue_False()
        {
            var proxy = MockRepository.GenerateMock<IConfigurationProxy>();
            proxy.Expect(p => p.GetHeaderValue("name")).Return("v3");
            ConfigurationProvider.Proxy = proxy;

            var target = new OperationConfiguration(HttpMethod.Get, "{id}");
            target.HttpHeader("name").IsEqualToValue("v1", "v2");

            Assert.IsFalse(target.IsMapped(null));

            proxy.VerifyAllExpectations();
        }       
Esempio n. 2
0
        private static OperationConfiguration GetOperationConfiguration(ApiDescription apiDescription, Func <OperationConfiguration, bool> where = null)
        {
            OperationConfiguration result = null;

            var config = GetResourceConfiguration(apiDescription.ActionDescriptor.ControllerDescriptor);

            if (config != null)
            {
                if (where == null)
                {
                    result = config.GetOperation(apiDescription.HttpMethod, apiDescription.RelativePath);
                }
                else
                {
                    result = config.GetOperation(apiDescription.HttpMethod, apiDescription.RelativePath, where);
                }
            }

            return(result);
        }