save checkpoint
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
using System.Net;
|
||||
using FluentAssertions;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc.Testing;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Xunit;
|
||||
|
||||
namespace StellaOps.Timeline.WebService.Tests;
|
||||
|
||||
[Trait("Category", "Integration")]
|
||||
public sealed class TimelineStartupRegistrationTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task Startup_WithPostgresStoreConfiguration_BuildsHost()
|
||||
{
|
||||
await using var factory = new WebApplicationFactory<StellaOps.Timeline.WebService.Program>()
|
||||
.WithWebHostBuilder(builder =>
|
||||
{
|
||||
builder.UseEnvironment("Development");
|
||||
builder.ConfigureAppConfiguration((_, config) =>
|
||||
{
|
||||
config.AddInMemoryCollection(new Dictionary<string, string?>
|
||||
{
|
||||
["Eventing:ServiceName"] = "timeline-tests",
|
||||
["Eventing:UseInMemoryStore"] = "false",
|
||||
["Eventing:ConnectionString"] = "Host=localhost;Port=5432;Database=timeline;Username=postgres;Password=postgres",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
using var client = factory.CreateClient();
|
||||
|
||||
var response = await client.GetAsync("/does-not-exist");
|
||||
|
||||
response.StatusCode.Should().Be(HttpStatusCode.NotFound);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user