Esempio n. 1
0
        public void InnerExceptionCtor()
        {
            string    message = "This is a test message.";
            Exception inner   = new Exception("This is a test exception");
            RuntimeBinderInternalCompilerException rbe = new RuntimeBinderInternalCompilerException(message, inner);

            Assert.Same(inner, rbe.InnerException);
        }
Esempio n. 2
0
        public void NullaryCtor()
        {
            RuntimeBinderInternalCompilerException rbe = new RuntimeBinderInternalCompilerException();

            Assert.Null(rbe.InnerException);
            Assert.Empty(rbe.Data);
            Assert.True((rbe.HResult & 0xFFFF0000) == 0x80130000); // Error from .NET
            Assert.Contains(rbe.GetType().FullName, rbe.Message);  // Localized, but should contain type name.
        }
Esempio n. 3
0
        public void InnerExceptionCtor()
        {
            string    message = "This is a test message.";
            Exception inner   = new Exception("This is a test exception");
            RuntimeBinderInternalCompilerException rbe = new RuntimeBinderInternalCompilerException(message, inner);

            Assert.Same(inner, rbe.InnerException);
            BinaryFormatterHelpers.AssertRoundtrips(rbe);
        }
Esempio n. 4
0
        public void StringCtor()
        {
            string message = "This is a test message.";
            RuntimeBinderInternalCompilerException rbe = new RuntimeBinderInternalCompilerException(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 RuntimeBinderInternalCompilerException(null);
            Assert.Equal(new RuntimeBinderInternalCompilerException().Message, rbe.Message);
        }