-
Notifications
You must be signed in to change notification settings - Fork 43
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
1 changed file
with
19 additions
and
26 deletions.
There are no files selected for viewing
45 changes: 19 additions & 26 deletions
45
test/Aliencube.AzureFunctions.Extensions.OpenApi.Tests/Resolvers/HostJsonResolverTests.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 |
---|---|---|
@@ -1,40 +1,33 @@ | ||
using Aliencube.AzureFunctions.Extensions.OpenApi.Resolvers; | ||
|
||
using FluentAssertions; | ||
|
||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
using Moq; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace Aliencube.AzureFunctions.Extensions.OpenApi.Tests.Resolvers | ||
{ | ||
[TestClass] | ||
public class HostJsonResolverTests | ||
{ | ||
[TestMethod] | ||
public void Given_Parameters_When_Resolve_Invoked_Then_It_Should_Return_Result() | ||
{ | ||
var section = new Mock<IConfigurationSection>(); | ||
section.SetupGet(p => p.Value).Returns(string.Empty); | ||
//[TestMethod] | ||
//public void Given_Parameters_When_Resolve_Invoked_Then_It_Should_Return_Result() | ||
//{ | ||
// var section = new Mock<IConfigurationSection>(); | ||
// section.SetupGet(p => p.Value).Returns(string.Empty); | ||
|
||
var env = new Mock<IConfiguration>(); | ||
env.Setup(p => p.GetSection(It.IsAny<string>())).Returns(section.Object); | ||
// var env = new Mock<IConfiguration>(); | ||
// env.Setup(p => p.GetSection(It.IsAny<string>())).Returns(section.Object); | ||
|
||
var result = HostJsonResolver.Resolve(env.Object); | ||
// var result = HostJsonResolver.Resolve(env.Object); | ||
|
||
result.Should().NotBeNull() | ||
.And.BeAssignableTo<IConfiguration>(); | ||
} | ||
// result.Should().NotBeNull() | ||
// .And.BeAssignableTo<IConfiguration>(); | ||
//} | ||
|
||
[TestMethod] | ||
public void Given_HostJson_When_GetHttpSettings_Invoked_Then_It_Should_Return_Result() | ||
{ | ||
var host = HostJsonResolver.Resolve(); | ||
//[TestMethod] | ||
//public void Given_HostJson_When_GetHttpSettings_Invoked_Then_It_Should_Return_Result() | ||
//{ | ||
// var host = HostJsonResolver.Resolve(); | ||
|
||
var result = host.GetHttpSettings(); | ||
// var result = host.GetHttpSettings(); | ||
|
||
result.RoutePrefix.Should().BeEquivalentTo("api"); | ||
} | ||
// result.RoutePrefix.Should().BeEquivalentTo("api"); | ||
//} | ||
} | ||
} |