public void CreateInstance_CreatesFilter()
    {
        // Arrange
        var properties = new LifecycleProperty[]
        {
            new LifecycleProperty(),
            new LifecycleProperty(),
        };
        var filterFactory = new PageViewDataAttributeFilterFactory(properties);

        // Act
        var result = filterFactory.CreateInstance(Mock.Of <IServiceProvider>());

        // Assert
        var filter = Assert.IsType <PageViewDataAttributeFilter>(result);

        Assert.Same(properties, filter.Properties);
    }
        /// <inheritdoc />
        public void OnProvidersExecuting(PageApplicationModelProviderContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            var handlerType = context.PageApplicationModel.HandlerType.AsType();

            var viewDataProperties = ViewDataAttributePropertyProvider.GetViewDataProperties(handlerType);

            if (viewDataProperties == null)
            {
                return;
            }

            var filter = new PageViewDataAttributeFilterFactory(viewDataProperties);

            context.PageApplicationModel.Filters.Add(filter);
        }