public void MatchError() { var result = OutputOrErrorLine.Error("foobar") .Match(_ => throw new NotImplementedException(), s => s.ToUpperInvariant()); Assert.That(result, Is.EqualTo("FOOBAR")); }
public void Error() { var error = OutputOrErrorLine.Error("foobar"); Assert.That(error.Kind, Is.EqualTo(OutputOrErrorKind.Error)); Assert.That(error.IsOutput(), Is.False); Assert.That(error.IsError(), Is.True); Assert.That(error.Value, Is.EqualTo("foobar")); Assert.That(error.ToString(), Is.EqualTo(error.Value)); var(kind, line) = error; Assert.That(kind, Is.EqualTo(error.Kind)); Assert.That(line, Is.EqualTo(error.Value)); }