-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocalStackTests.cs
More file actions
49 lines (43 loc) · 1.2 KB
/
Copy pathLocalStackTests.cs
File metadata and controls
49 lines (43 loc) · 1.2 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
namespace Envilder.Examples.Tests;
using System.Net.Http.Json;
using System.Text.Json;
using Amazon.SimpleSystemsManagement;
using Amazon.SimpleSystemsManagement.Model;
using AwesomeAssertions;
public sealed class LocalStackTests(LocalStackFixture fixture)
: IClassFixture<LocalStackFixture>
{
[Fact]
public async Task Should_ReportSsmService_When_LocalStackIsRunning()
{
// Act
var health = await fixture.Http.GetFromJsonAsync<JsonElement>(
"/_localstack/health", TestContext.Current.CancellationToken);
// Assert
health.GetProperty("services").GetProperty("ssm").GetString()
.Should().BeOneOf("available", "running");
}
[Fact]
public async Task Should_RoundTripSecureString_When_LocalStackStartsWithResolvedToken()
{
// Arrange
await fixture.Ssm.PutParameterAsync(
new PutParameterRequest
{
Name = "/demo/secret",
Value = "hunter2",
Type = ParameterType.SecureString,
},
TestContext.Current.CancellationToken);
// Act
var actual = await fixture.Ssm.GetParameterAsync(
new GetParameterRequest
{
Name = "/demo/secret",
WithDecryption = true,
},
TestContext.Current.CancellationToken);
// Assert
actual.Parameter.Value.Should().Be("hunter2");
}
}