forked from Azure/azure-functions-openapi-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
...Jobs.Extensions.OpenApi.Document.Tests/Configurations/OpenApiConfigurationOptionsTests.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,38 @@ | ||
using System; | ||
using System.Net.Http; | ||
using System.Threading.Tasks; | ||
|
||
using FluentAssertions; | ||
|
||
using Microsoft.OpenApi.Models; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
using Newtonsoft.Json; | ||
|
||
namespace Microsoft.Azure.WebJobs.Extensions.OpenApi.Document.Tests.OpenApiInfo | ||
{ | ||
[TestClass] | ||
[TestCategory(Constants.TestCategory)] | ||
public class OpenApiConfigurationOptionsTests | ||
{ | ||
private static HttpClient http = new HttpClient(); | ||
|
||
private string _json; | ||
private OpenApiDocument _doc; | ||
|
||
[TestInitialize] | ||
public async Task Init() | ||
{ | ||
this._json = await http.GetStringAsync(Constants.OpenApiDocEndpoint).ConfigureAwait(false); | ||
this._doc = JsonConvert.DeserializeObject<OpenApiDocument>(this._json); | ||
} | ||
|
||
[TestMethod] | ||
public void Given_OpenApiDocument_When_ForceHttps_Given_Then_It_Should_Return_Https() | ||
{ | ||
var servers = this._doc.Servers; | ||
|
||
servers[0].Url.Should().Be("https://localhost:7071/api"); | ||
} | ||
} | ||
} |
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