/// <summary>
        /// </summary>
        /// <param name="config"></param>
        /// <param name="tableConfigProvider"></param>
        public static void SetTableControllerConfigProvider(this HttpConfiguration config, ITableControllerConfigProvider tableConfigProvider)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            config.Properties[TableControllerConfigProviderKey] = tableConfigProvider;
        }
Ejemplo n.º 2
0
        public void GetTableControllerConfigProvider_ReturnsDefaultInstance()
        {
            // Arrange
            HttpConfiguration config = new HttpConfiguration();

            // Act
            ITableControllerConfigProvider actual = config.GetTableControllerConfigProvider();

            // Assert
            Assert.NotNull(actual);
            Assert.IsType <TableControllerConfigProvider>(actual);
        }
Ejemplo n.º 3
0
        /// <inheritdoc />
        public override void Initialize(HttpControllerSettings controllerSettings, HttpControllerDescriptor controllerDescriptor)
        {
            if (controllerDescriptor == null)
            {
                throw new ArgumentNullException("controllerDescriptor");
            }

            base.Initialize(controllerSettings, controllerDescriptor);

            ITableControllerConfigProvider tableConfigurationProvider = controllerDescriptor.Configuration.GetTableControllerConfigProvider();

            tableConfigurationProvider.Configure(controllerSettings, controllerDescriptor);
        }
Ejemplo n.º 4
0
        public void SetMobileAppControllerConfigProvider_ReturnsDefault_IfSetToNull()
        {
            // Arrange
            HttpConfiguration config = new HttpConfiguration();

            // Act
            config.SetMobileAppControllerConfigProvider(null);
            ITableControllerConfigProvider actual = config.GetTableControllerConfigProvider();

            // Assert
            Assert.NotNull(actual);
            Assert.IsType <TableControllerConfigProvider>(actual);
        }
Ejemplo n.º 5
0
        public void SetMobileAppControllerConfigProvider_Roundtrips()
        {
            // Arrange
            TableControllerConfigProvider provider = new TableControllerConfigProvider();
            HttpConfiguration             config   = new HttpConfiguration();

            // Act
            config.SetTableControllerConfigProvider(provider);
            ITableControllerConfigProvider actual = config.GetTableControllerConfigProvider();

            // Assert
            Assert.Same(provider, actual);
        }
        public static MobileAppConfiguration WithTableControllerConfigProvider(this MobileAppConfiguration options, ITableControllerConfigProvider tableConfigProvider)
        {
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            if (tableConfigProvider == null)
            {
                throw new ArgumentNullException("tableConfigProvider");
            }

            options.RegisterConfigProvider(new TableMobileAppExtensionConfig(tableConfigProvider));
            return options;
        }
Ejemplo n.º 7
0
 public TableExtensionConfigTests()
 {
     this.config         = new HttpConfiguration();
     this.configProvider = new TableControllerConfigProvider();
     this.tableExtension = new TableMobileAppExtensionConfig(this.configProvider);
 }
Ejemplo n.º 8
0
        /// <summary>
        /// </summary>
        /// <param name="config"></param>
        /// <param name="tableConfigProvider"></param>
        public static void SetTableControllerConfigProvider(this HttpConfiguration config, ITableControllerConfigProvider tableConfigProvider)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            config.Properties[TableControllerConfigProviderKey] = tableConfigProvider;
        }
 public TableExtensionConfigTests()
 {
     this.config = new HttpConfiguration();
     this.configProvider = new TableControllerConfigProvider();
     this.tableExtension = new TableMobileAppExtensionConfig(this.configProvider);
 }
 /// <summary>
 /// </summary>
 /// <param name="provider"></param>
 public TableMobileAppExtensionConfig(ITableControllerConfigProvider provider)
 {
     this.provider = provider;
 }
Ejemplo n.º 11
0
        public static MobileAppConfiguration WithTableControllerConfigProvider(this MobileAppConfiguration options, ITableControllerConfigProvider tableConfigProvider)
        {
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            if (tableConfigProvider == null)
            {
                throw new ArgumentNullException("tableConfigProvider");
            }

            options.RegisterConfigProvider(new TableMobileAppExtensionConfig(tableConfigProvider));
            return(options);
        }
Ejemplo n.º 12
0
 /// <summary>
 /// </summary>
 /// <param name="provider"></param>
 public TableMobileAppExtensionConfig(ITableControllerConfigProvider provider)
 {
     this.provider = provider;
 }