25 lines
842 B
C#
25 lines
842 B
C#
using Npgsql;
|
|
using StellaOps.JobEngine.Infrastructure.Postgres;
|
|
|
|
namespace StellaOps.JobEngine.Tests.DeadLetter;
|
|
|
|
public sealed class PostgresDeadLetterRepositoryTests
|
|
{
|
|
[Theory]
|
|
[InlineData(PostgresErrorCodes.UndefinedFunction)]
|
|
[InlineData(PostgresErrorCodes.AmbiguousColumn)]
|
|
public void ShouldUseActionableSummaryFallback_ReturnsTrue_ForRecoverableLegacySqlStates(string sqlState)
|
|
{
|
|
Assert.True(PostgresDeadLetterRepository.ShouldUseActionableSummaryFallback(sqlState));
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData(PostgresErrorCodes.UndefinedTable)]
|
|
[InlineData("XX000")]
|
|
[InlineData(null)]
|
|
public void ShouldUseActionableSummaryFallback_ReturnsFalse_ForNonFallbackSqlStates(string? sqlState)
|
|
{
|
|
Assert.False(PostgresDeadLetterRepository.ShouldUseActionableSummaryFallback(sqlState));
|
|
}
|
|
}
|