/// <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 void GetTableControllerConfigProvider_ReturnsDefaultInstance() { // Arrange HttpConfiguration config = new HttpConfiguration(); // Act ITableControllerConfigProvider actual = config.GetTableControllerConfigProvider(); // Assert Assert.NotNull(actual); Assert.IsType <TableControllerConfigProvider>(actual); }
/// <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); }
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); }
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; }
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; }
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); }