-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(slimfaas): add test to Program.cs
- Loading branch information
1 parent
cd79850
commit cca0a87
Showing
3 changed files
with
28 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Net; | ||
using Microsoft.Extensions.Logging; | ||
using Moq; | ||
using System.Text.Json; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc.Testing; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace SlimFaas.Tests; | ||
|
||
public class ProgramShould | ||
{ | ||
[Fact] | ||
public async Task TestRootEndpoint() | ||
{ | ||
Environment.SetEnvironmentVariable("MOCK_REDIS", "true"); | ||
Environment.SetEnvironmentVariable("MOCK_KUBERNETES_FUNCTIONS", "{\"Functions\":[{\"Name\":\"fibonacci1\",\"NumberParallelRequest\":1},{\"Name\":\"fibonacci2\",\"NumberParallelRequest\":1}]}"); | ||
await using var application = new WebApplicationFactory<Program>(); | ||
using var client = application.CreateClient(); | ||
|
||
var response = await client.GetStringAsync("/health"); | ||
|
||
Assert.Equal("OK", response); | ||
} | ||
} |
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