Ejemplo n.º 1
0
        public void ArsMagnaException_Construction_1()
        {
            ArsMagnaException exception = new ArsMagnaException();

            Assert.IsNotNull(exception.Message);
            Assert.IsNull(exception.InnerException);
            BinaryAttachment[] attachments = exception.ListAttachments();
            Assert.IsNotNull(attachments);
            Assert.AreEqual(0, attachments.Length);
        }
Ejemplo n.º 2
0
        public void ArsMagnaException_Construction_3()
        {
            Exception         innerException = new Exception();
            const string      message        = "Message";
            ArsMagnaException exception      = new ArsMagnaException(message, innerException);

            Assert.AreEqual(message, exception.Message);
            Assert.AreSame(innerException, exception.InnerException);
            BinaryAttachment[] attachments = exception.ListAttachments();
            Assert.IsNotNull(attachments);
            Assert.AreEqual(0, attachments.Length);
        }
Ejemplo n.º 3
0
        public void ArsMagnaException_Attach_1()
        {
            ArsMagnaException exception  = new ArsMagnaException();
            BinaryAttachment  attachment = new BinaryAttachment
                                           (
                "first",
                new byte[] { 1, 2, 3 }
                                           );

            exception.Attach(attachment);
            BinaryAttachment[] attachments = exception.ListAttachments();
            Assert.AreEqual(1, attachments.Length);
            Assert.AreSame(attachment, attachments[0]);
            Assert.AreEqual("first", attachments[0].Name);
            Assert.AreEqual(3, attachments[0].Content.Length);
        }
Ejemplo n.º 4
0
        public void ArsMagnaException_Attach_2()
        {
            ArsMagnaException exception   = new ArsMagnaException();
            BinaryAttachment  attachment1 = new BinaryAttachment
                                            (
                "first",
                new byte[] { 1, 2, 3 }
                                            );

            exception.Attach(attachment1);
            BinaryAttachment attachment2 = new BinaryAttachment
                                           (
                "second",
                new byte[] { 3, 2, 1 }
                                           );

            exception.Attach(attachment2);
            BinaryAttachment[] attachments = exception.ListAttachments();
            Assert.AreEqual(2, attachments.Length);
            Assert.AreSame(attachment1, attachments[0]);
            Assert.AreSame(attachment2, attachments[1]);
        }