Пример #1
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, null));
        }
Пример #2
0
        protected OperationFilterContext FilterContextFor <T>(string actionFixtureName) where T : class
        {
            var fakeProvider    = new FakeApiDescriptionGroupCollectionProvider();
            var apiDescriptions = fakeProvider.Add <T>(actionFixtureName);
            var apiDescription  = apiDescriptions.ApiDescriptionGroups.Items.First().Items.First();

            return(new OperationFilterContext(
                       apiDescription,
                       new SchemaRegistry(new JsonSerializerSettings()),
                       typeof(T).GetMethod(actionFixtureName)));
        }
        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 DefaultSchemaRegistry(new JsonSerializerSettings())));
        }