public void ApplicationModelConventions_CopiesControllerModelCollectionOnApply_WhenRegisteredAsAnAttribute()
    {
        // Arrange
        var controllerModelConvention = new ControllerModelCollectionModifyingConvention();
        var applicationModel          = new ApplicationModel();

        applicationModel.Controllers.Add(
            new ControllerModel(typeof(HelloController).GetTypeInfo(), new[] { controllerModelConvention })
        {
            Application = applicationModel
        });

        var conventions = new List <IApplicationModelConvention>();

        // Act & Assert
        ApplicationModelConventions.ApplyConventions(applicationModel, conventions);
    }
Beispiel #2
0
        public void ApplicationModelConventions_CopiesControllerModelCollectionOnApply()
        {
            // Arrange
            var applicationModel = new ApplicationModel();

            applicationModel.Controllers.Add(
                new ControllerModel(typeof(HelloController).GetTypeInfo(), new List <object>())
            {
                Application = applicationModel
            });

            var controllerModelConvention = new ControllerModelCollectionModifyingConvention();
            var conventions = new List <IApplicationModelConvention>();

            conventions.Add(controllerModelConvention);

            // Act & Assert
            ApplicationModelConventions.ApplyConventions(applicationModel, conventions);
        }