-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathServeStaticTests.cs
More file actions
35 lines (29 loc) · 1.09 KB
/
ServeStaticTests.cs
File metadata and controls
35 lines (29 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
using Aspire.Hosting.Testing;
using AwesomeAssertions;
using Elastic.Documentation.Aspire;
namespace Elastic.Documentation.IntegrationTests;
public class ServeStaticTests(DocumentationFixture fixture, ITestOutputHelper output) : IAsyncLifetime
{
[Fact]
public async Task AssertRequestToRootReturnsData()
{
var client = fixture.DistributedApplication.CreateHttpClient(ResourceNames.AssemblerServe, "http");
var root = await client.GetStringAsync("/", TestContext.Current.CancellationToken);
_ = root.Should().NotBeNullOrEmpty();
}
/// <inheritdoc />
public ValueTask DisposeAsync()
{
GC.SuppressFinalize(this);
if (TestContext.Current.TestState?.Result is not TestResult.Failed)
return default;
foreach (var resource in fixture.InMemoryLogger.RecordedLogs)
output.WriteLine(resource.Message);
return default;
}
/// <inheritdoc />
public ValueTask InitializeAsync() => default;
}