using ZB.MOM.WW.ScadaBridge.DelmiaNotifier;

namespace ZB.MOM.WW.ScadaBridge.DelmiaNotifier.Tests;

public class ReporterTests
{
    [Fact]
    public void Success_writes_YES_and_returns_0()
    {
        using var sw = new StringWriter();
        var code = Reporter.Report(true, "", sw);
        Assert.Equal("YES\n", sw.ToString());
        Assert.Equal(0, code);
    }

    [Fact]
    public void Failure_writes_NO_then_reason_and_returns_minus1()
    {
        using var sw = new StringWriter();
        var code = Reporter.Report(false, "boom", sw);
        Assert.Equal("NO\nboom", sw.ToString());
        Assert.Equal(-1, code);
    }
}
