-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Richard Beauchamp
committed
Dec 7, 2015
1 parent
801f5c2
commit 7163d50
Showing
39 changed files
with
76 additions
and
5,573 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Web.Http.Description; | ||
using Swashbuckle.Swagger; | ||
|
||
namespace Swashbuckle.OData.Tests | ||
{ | ||
public class ApplyDocumentVendorExtensions : IDocumentFilter | ||
{ | ||
public void Apply(SwaggerDocument swaggerDoc, SchemaRegistry schemaRegistry, IApiExplorer apiExplorer) | ||
{ | ||
swaggerDoc.host = "foo"; | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
Swashbuckle.OData.Tests/Fixtures/ODataSwaggerProviderTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using FluentAssertions; | ||
using Microsoft.Owin.Hosting; | ||
using Newtonsoft.Json.Linq; | ||
using NUnit.Framework; | ||
using Swashbuckle.Application; | ||
using Swashbuckle.OData.Tests.WebHost; | ||
using Swashbuckle.Swagger; | ||
|
||
namespace Swashbuckle.OData.Tests | ||
{ | ||
[TestFixture] | ||
public class ODataSwaggerProviderTests | ||
{ | ||
[Test] | ||
public async Task It_applies_document_filters() | ||
{ | ||
// Arrange | ||
Action<SwaggerDocsConfig> config = c => c.DocumentFilter<ApplyDocumentVendorExtensions>(); | ||
var httpClient = HttpClientUtils.GetHttpClient(); | ||
|
||
using (WebApp.Start(TestWebApiStartup.BaseAddress, appBuilder => new TestWebApiStartup().Configuration(appBuilder, config))) | ||
{ | ||
// Act | ||
var swaggerDocument = await httpClient.GetJsonAsync<SwaggerDocument>("swagger/docs/v1"); | ||
|
||
// Assert | ||
swaggerDocument.host.Should().Be("foo"); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.