using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery;
namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests.Delivery;
public class DeliveryOutcomeTests
{
/// Verifies that a success outcome carries the resolved targets and no error.
[Fact]
public void Success_SetsResolvedTargets_AndNoError()
{
var outcome = DeliveryOutcome.Success("targets");
Assert.Equal(DeliveryResult.Success, outcome.Result);
Assert.Equal("targets", outcome.ResolvedTargets);
Assert.Null(outcome.Error);
}
/// Verifies that a transient outcome carries an error and no resolved targets.
[Fact]
public void Transient_SetsError_AndNoResolvedTargets()
{
var outcome = DeliveryOutcome.Transient("e");
Assert.Equal(DeliveryResult.TransientFailure, outcome.Result);
Assert.Equal("e", outcome.Error);
Assert.Null(outcome.ResolvedTargets);
}
/// Verifies that a permanent outcome carries an error and no resolved targets.
[Fact]
public void Permanent_SetsError_AndNoResolvedTargets()
{
var outcome = DeliveryOutcome.Permanent("e");
Assert.Equal(DeliveryResult.PermanentFailure, outcome.Result);
Assert.Equal("e", outcome.Error);
Assert.Null(outcome.ResolvedTargets);
}
}