save progress
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
using FluentAssertions;
|
||||
|
||||
namespace StellaOps.Audit.ReplayToken.Tests;
|
||||
|
||||
public sealed class ReplayCliSnippetGeneratorTests
|
||||
{
|
||||
[Fact]
|
||||
public void GenerateDecisionReplay_QuotesValuesAndOmitsPlus()
|
||||
{
|
||||
var generator = new ReplayCliSnippetGenerator();
|
||||
var token = new ReplayToken("abc123", DateTimeOffset.UnixEpoch);
|
||||
|
||||
var output = generator.GenerateDecisionReplay(
|
||||
token,
|
||||
"alert 1",
|
||||
"file:///tmp/with space",
|
||||
"policy v1");
|
||||
|
||||
output.Should().Contain("--token 'abc123'");
|
||||
output.Should().Contain("--alert-id 'alert 1'");
|
||||
output.Should().Contain("--feed-manifest 'file:///tmp/with space'");
|
||||
output.Should().Contain("--policy-version 'policy v1'");
|
||||
output.Should().NotContain("\n+");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GenerateScoringReplay_EscapesSingleQuotes()
|
||||
{
|
||||
var generator = new ReplayCliSnippetGenerator();
|
||||
var token = new ReplayToken("abc123", DateTimeOffset.UnixEpoch);
|
||||
|
||||
var output = generator.GenerateScoringReplay(token, "subject'key", "config'v1");
|
||||
|
||||
output.Should().Contain("--subject 'subject'\"'\"'key'");
|
||||
output.Should().Contain("--config-version 'config'\"'\"'v1'");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user