Example #1
0
        public void StringCtor()
        {
            string message             = "This is a test message.";
            RuntimeBinderException rbe = new RuntimeBinderException(message);

            Assert.Null(rbe.InnerException);
            Assert.Empty(rbe.Data);
            Assert.True((rbe.HResult & 0xFFFF0000) == 0x80130000); // Error from .NET
            Assert.Same(message, rbe.Message);
            rbe = new RuntimeBinderException(null);
            Assert.Equal(new RuntimeBinderException().Message, rbe.Message);
            BinaryFormatterHelpers.AssertRoundtrips(rbe);
        }
        public void SerializationRoundTrip()
        {
            var ex = new InvalidOleVariantTypeException("E_BAD_PIZZA");

            BinaryFormatterHelpers.AssertRoundtrips(ex);
        }
Example #3
0
        public void SerializationRoundTrip()
        {
            var ex = new MarshalDirectiveException("E_BAD_PIZZA");

            BinaryFormatterHelpers.AssertRoundtrips(ex);
        }
Example #4
0
 public static void SerializeDeserialize(Win32Exception exception)
 {
     BinaryFormatterHelpers.AssertRoundtrips(exception, e => e.NativeErrorCode, e => e.ErrorCode);
 }
Example #5
0
 public void RegexMatchTimeoutExceptionSerialization(RegexMatchTimeoutException ex)
 {
     BinaryFormatterHelpers.AssertRoundtrips(ex, e => e.Input, e => e.Pattern, e => e.MatchTimeout);
 }
Example #6
0
        public void SerializationRoundTrip()
        {
            var ex = new SafeArrayRankMismatchException("E_BAD_PIZZA");

            BinaryFormatterHelpers.AssertRoundtrips(ex);
        }
Example #7
0
        public void SerializationRoundTrip()
        {
            var ex = new COMException("E_BAD_PIZZA", -1337);

            BinaryFormatterHelpers.AssertRoundtrips(ex);
        }
 public static void ExceptionRoundtrips()
 {
     BinaryFormatterHelpers.AssertRoundtrips(new InternalBufferOverflowException());
 }