27 lines
801 B
C#
27 lines
801 B
C#
|
|
using FluentAssertions;
|
||
|
|
using PiiRedaction.Core.Sanitization;
|
||
|
|
using PiiRedaction.Core.Tests.TestSupport;
|
||
|
|
|
||
|
|
namespace PiiRedaction.Core.Tests.Sanitization;
|
||
|
|
|
||
|
|
[TestFixture]
|
||
|
|
public sealed class PromptSanitizerTests
|
||
|
|
{
|
||
|
|
[Test]
|
||
|
|
public void Sanitize_NullRequest_ThrowsArgumentNullException()
|
||
|
|
{
|
||
|
|
var sanitizer = ProductionPipelineFactory.Create().Sanitizer;
|
||
|
|
var action = () => sanitizer.Sanitize(null!);
|
||
|
|
action.Should().Throw<ArgumentNullException>();
|
||
|
|
}
|
||
|
|
|
||
|
|
[TestCase("")]
|
||
|
|
[TestCase(" ")]
|
||
|
|
public void Sanitize_WhitespacePrompt_ThrowsArgumentException(string prompt)
|
||
|
|
{
|
||
|
|
var sanitizer = ProductionPipelineFactory.Create().Sanitizer;
|
||
|
|
var action = () => sanitizer.Sanitize(new(prompt));
|
||
|
|
action.Should().Throw<ArgumentException>();
|
||
|
|
}
|
||
|
|
}
|