-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
10 changed files
with
109 additions
and
32 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
33 changes: 22 additions & 11 deletions
33
src/Homely.AspNetCore.Mvc.Helpers/Extensions/IServiceCollectionExtensions.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
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
35 changes: 35 additions & 0 deletions
35
tests/Homely.AspNetCore.Mvc.Helpers.Tests/SwaggerTests/CustomSwaggerTests.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,35 @@ | ||
using Shouldly; | ||
using System.Threading.Tasks; | ||
using Xunit; | ||
|
||
namespace Homely.AspNetCore.Mvc.Helpers.Tests.SwaggerTests | ||
{ | ||
public class CustomSwaggerTests : TestSetup | ||
{ | ||
[Fact] | ||
public async Task GivenASwaggerUiRequest_Get_ReturnsAnHttp200() | ||
{ | ||
// Arrange. | ||
|
||
// Act. | ||
var response = await Client.GetAsync("/swagger/index.html"); | ||
|
||
// Assert. | ||
response.IsSuccessStatusCode.ShouldBeTrue(); | ||
} | ||
|
||
[Fact] | ||
public async Task GivenASwaggerRequest_Get_ReturnsAnHttp200() | ||
{ | ||
// Arrange. | ||
|
||
// Act. | ||
var response = await Client.GetAsync("/swagger/v2/swagger.json"); | ||
|
||
// Assert. | ||
response.IsSuccessStatusCode.ShouldBeTrue(); | ||
response.Content.Headers.ContentType.MediaType.ShouldBe("application/json"); | ||
response.Content.Headers.ContentType.CharSet.ShouldBe("utf-8"); | ||
} | ||
} | ||
} |
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
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