Exemplo n.º 1
0
    public void ExceptionInfoSerialization()
    {
        var n = default(ExceptionInfo);

        n.ToException().Should().BeNull();
        n = new ExceptionInfo(null !);
        n = n.AssertPassesThroughAllSerializers(Out);
        n.ToException().Should().BeNull();

        var e = new InvalidOperationException("Fail!");
        var p = e.ToExceptionInfo();

        p = p.AssertPassesThroughAllSerializers(Out);
        var e1 = p.ToException();

        e1.Should().BeOfType <InvalidOperationException>();
        e1 !.Message.Should().Be(e.Message);
    }