using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery;

namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests.Delivery;

public class DeliveryOutcomeTests
{
    [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);
    }

    [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);
    }

    [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);
    }
}
