private OperationFilterContext FilterContextFor(string actionFixtureName)
        {
            var fakeProvider   = new FakeApiDescriptionGroupCollectionProvider();
            var apiDescription = fakeProvider
                                 .Add("GET", "collection", actionFixtureName)
                                 .ApiDescriptionGroups.Items.First()
                                 .Items.First();

            return(new OperationFilterContext(apiDescription, null));
        }
        private OperationFilterContext FilterContextFor(string actionFixtureName)
        {
            var fakeProvider   = new FakeApiDescriptionGroupCollectionProvider();
            var apiDescription = fakeProvider
                                 .Add("GET", "collection", actionFixtureName, typeof(XmlAnnotatedController))
                                 .ApiDescriptionGroups.Items.First()
                                 .Items.First();

            var methodInfo = (apiDescription.ActionDescriptor as ControllerActionDescriptor).MethodInfo;

            return(new OperationFilterContext(apiDescription, null, null, methodInfo));
        }
Exemplo n.º 3
0
        private OperationFilterContext FilterContextFor(string actionFixtureName)
        {
            var fakeProvider   = new FakeApiDescriptionGroupCollectionProvider();
            var apiDescription = fakeProvider
                                 .Add("GET", "collection", actionFixtureName)
                                 .ApiDescriptionGroups.Items.First()
                                 .Items.First();

            return(new OperationFilterContext(
                       apiDescription,
                       new SchemaRegistry(new JsonSerializerSettings()),
                       (apiDescription.ActionDescriptor as ControllerActionDescriptor).MethodInfo));
        }
        private OperationFilterContext FilterContextFor(
            string actionFixtureName,
            string controllerFixtureName = "NotAnnotated")
        {
            var fakeProvider   = new FakeApiDescriptionGroupCollectionProvider();
            var apiDescription = fakeProvider
                                 .Add("GET", "collection", actionFixtureName, controllerFixtureName)
                                 .ApiDescriptionGroups.Items.First()
                                 .Items.First();

            return(new OperationFilterContext(
                       apiDescription,
                       new SchemaRegistry(new JsonSerializerSettings())));
        }
        private OperationFilterContext FilterContextFor(
            string actionFixtureName,
            string controllerFixtureName = "NotAnnotated",
            Type controllerType          = null)
        {
            var fakeProvider   = new FakeApiDescriptionGroupCollectionProvider();
            var apiDescription = fakeProvider
                                 .Add("GET", "collection", actionFixtureName, controllerFixtureName)
                                 .ApiDescriptionGroups.Items.First()
                                 .Items.First();

            var mi = (controllerType ?? typeof(FakeActions)).GetMethod(actionFixtureName);

            return(new OperationFilterContext(
                       apiDescription,
                       new SchemaRegistry(new JsonSerializerSettings()),
                       mi));
        }