Skip to content

Commit

Permalink
Add Task Azure#3 Test Code (Azure#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
CistusF authored and Derich367 committed Jan 30, 2023
1 parent 536181b commit d17e8db
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
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");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet"
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"OpenApi__ForceHttps": "true"
}
}

0 comments on commit d17e8db

Please sign in to comment.