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); }
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. }
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); }
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); }