public void RegisterMappingsMiddleware_RegistersComponents()
        {
            // Arrange
            ContainerBuilder   containerBuilder = new ContainerBuilder();
            IConfigurationRoot config           = new ConfigurationBuilder().Build();
            ApiExplorer        apiExplorer      = new ApiExplorer(new HttpConfiguration());

            // Act
            MappingsContainerBuilderExtensions.RegisterMappingsActuator(containerBuilder, config, apiExplorer);
            var container = containerBuilder.Build();

            // Assert
            Assert.True(container.IsRegistered <IMappingsOptions>(), "Mappings options are registered");
            Assert.True(container.IsRegistered <MappingsEndpoint>(), "Mappings endpoint is registered");
            Assert.True(container.IsRegistered <MappingsEndpointOwinMiddleware>(), "Mappings endpoint middleware is registered");
        }
        public void RegisterMappingsMiddleware_ThrowsOnNulls()
        {
            // Arrange
            ContainerBuilder   containerNull    = null;
            ContainerBuilder   containerBuilder = new ContainerBuilder();
            IConfigurationRoot configNull       = null;
            IConfigurationRoot config           = new ConfigurationBuilder().Build();
            ApiExplorer        apiExplorerNull  = null;
            ApiExplorer        apiExplorer      = new ApiExplorer(new HttpConfiguration());

            // Act
            var ex  = Assert.Throws <ArgumentNullException>(() => MappingsContainerBuilderExtensions.RegisterMappingsActuator(containerNull, config, apiExplorer));
            var ex2 = Assert.Throws <ArgumentNullException>(() => MappingsContainerBuilderExtensions.RegisterMappingsActuator(containerBuilder, configNull, apiExplorer));
            var ex3 = Assert.Throws <ArgumentNullException>(() => MappingsContainerBuilderExtensions.RegisterMappingsActuator(containerBuilder, config, apiExplorerNull));

            // Assert
            Assert.Equal("container", ex.ParamName);
            Assert.Equal("config", ex2.ParamName);
            Assert.Equal("apiExplorer", ex3.ParamName);
        }