public void add_odata_api_explorer_should_use_default_settings() { // arrange var configuration = new HttpConfiguration(); // act var apiExplorer = configuration.AddODataApiExplorer(); // assert apiExplorer.UseApiExplorerSettings.Should().BeFalse(); }
public void add_odata_api_explorer_should_use_api_explorer_settings_when_enabled() { // arrange var configuration = new HttpConfiguration(); // act var apiExplorer = configuration.AddODataApiExplorer(useApiExplorerSettings: true); // assert apiExplorer.UseApiExplorerSettings.Should().BeTrue(); }
public void add_odata_api_explorer_should_use_api_explorer_settings_when_enabled() { // arrange var configuration = new HttpConfiguration(); var options = default(ODataApiExplorerOptions); // act configuration.AddODataApiExplorer(o => { o.UseApiExplorerSettings = true; options = o; }); // assert options.UseApiExplorerSettings.Should().BeTrue(); }
public void add_odata_api_explorer_should_use_default_settings() { // arrange var configuration = new HttpConfiguration(); var options = default(ODataApiExplorerOptions); // act configuration.AddODataApiExplorer(o => options = o); // assert options.UseApiExplorerSettings.Should().BeFalse(); }
/// <summary> /// Adds or replaces the configured <see cref="IApiExplorer">API explorer</see> with an implementation that supports OData and API versioning. /// </summary> /// <param name="configuration">The <see cref="HttpConfiguration">configuration</see> used to add the API explorer.</param> /// <returns>The newly registered <see cref="ODataApiExplorer">versioned OData API explorer</see>.</returns> /// <remarks>This method always replaces the <see cref="IApiExplorer"/> with a new instance of <see cref="ODataApiExplorer"/>. This method also /// configures the <see cref="ODataApiExplorer"/> to not use <see cref="ApiExplorerSettingsAttribute"/>, which enables exploring all OData /// controllers without additional configuration.</remarks> public static ODataApiExplorer AddODataApiExplorer(this HttpConfiguration configuration) => configuration.AddODataApiExplorer(_ => { });
/// <summary> /// Adds or replaces the configured <see cref="IApiExplorer">API explorer</see> with an implementation that supports OData and API versioning. /// </summary> /// <param name="configuration">The <see cref="HttpConfiguration">configuration</see> used to add the API explorer.</param> /// <returns>The newly registered <see cref="ODataApiExplorer">versioned OData API explorer</see>.</returns> /// <remarks>This method always replaces the <see cref="IApiExplorer"/> with a new instance of <see cref="ODataApiExplorer"/>. This method also /// configures the <see cref="ODataApiExplorer"/> to not use <see cref="ApiExplorerSettingsAttribute"/>, which enables exploring all OData /// controllers without additional configuration.</remarks> public static ODataApiExplorer AddODataApiExplorer(this HttpConfiguration configuration) => configuration.AddODataApiExplorer(useApiExplorerSettings: false);