Ejemplo n.º 1
0
        public void XunitException()
        {
            var ex = new XunitException("This is the message");

            var result = ExceptionUtility.GetMessage(ex);

            Assert.Equal("This is the message", result);
        }
Ejemplo n.º 2
0
        public void AggregateException()
        {
            var inner1 = new DivideByZeroException("inner #1");
            var inner2 = new NotImplementedException("inner #2");
            var inner3 = new XunitException("this is crazy");
            var outer = new AggregateException(inner1, inner2, inner3);

            var result = ExceptionUtility.GetMessage(outer);

            Assert.Equal("System.AggregateException : One or more errors occurred." + Environment.NewLine
                       + "---- System.DivideByZeroException : inner #1" + Environment.NewLine
                       + "---- System.NotImplementedException : inner #2" + Environment.NewLine
                       + "---- this is crazy", result);
        }
Ejemplo n.º 3
0
    public void UserMessageIsTheMessage()
    {
        var ex = new XunitException("UserMessage");

        Assert.Equal(ex.UserMessage, ex.Message);
    }
Ejemplo n.º 4
0
    public void PreservesUserMessage()
    {
        var ex = new XunitException("UserMessage");

        Assert.Equal("UserMessage", ex.UserMessage);
    }