예제 #1
0
        public static HttpConfiguration GetHttpConfiguration(this Type[] controllers)
        {
            var resolver      = new TestAssemblyResolver(new MockAssembly(controllers));
            var configuration = new HttpConfiguration();

            configuration.Services.Replace(typeof(IAssembliesResolver), resolver);
            return(configuration);
        }
예제 #2
0
        public ODataContainmentTest()
        {
            var controllers = new[] { typeof(MyOrdersController) };
            var resolver    = new TestAssemblyResolver(new MockAssembly(controllers));

            _configuration = new HttpConfiguration {
                IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always
            };
            _configuration.Services.Replace(typeof(IAssembliesResolver), resolver);

            _configuration.Count().OrderBy().Filter().Expand().MaxTop(null);
            _configuration.MapODataServiceRoute("odata", "odata", GetEdmModel());
            var server = new HttpServer(_configuration);

            _client = new HttpClient(server);
        }