示例#1
0
        public void TestInitialize()
        {
            var converter          = new Mock <IFormatterConverter>();
            SerializationInfo info = new SerializationInfo(typeof(DeserializableTextTransformationException), converter.Object);

            _errors = new CompilerErrorCollection
            {
                new CompilerError("bla,", 0, 1, "1234", "BlabBlablABl"),
                new CompilerError("bla,", 0, 2, "1234", "BlabBlablABl"),
                new CompilerError("bla,", 0, 3, "1234", "BlabBlablABl"),
                new CompilerError("bla,", 0, 4, "1234", "BlabBlablABl")
            };

            info.AddValue("compilationError", _errors);
            info.AddValue("templateClass", Template);

            //next values are neccessary for Exception base class
            info.AddValue("ClassName", "ThisIsAClass");
            info.AddValue("Message", "ThisIsAMessage");
            info.AddValue("InnerException", null);
            info.AddValue("HelpURL", string.Empty);
            info.AddValue("StackTraceString", string.Empty);
            info.AddValue("RemoteStackTraceString", string.Empty);
            info.AddValue("RemoteStackIndex", 6);
            info.AddValue("ExceptionMethod", string.Empty);
            info.AddValue("Source", string.Empty);
            info.AddValue("HResult", 1234);

            _result = new DeserializableTextTransformationException(info, new StreamingContext());
        }
示例#2
0
 public void TestInitialize()
 {
     _errors = new CompilerErrorCollection
     {
         new CompilerError("bla,", 0, 1, "1234", "BlabBlablABl"),
         new CompilerError("bla,", 0, 2, "1234", "BlabBlablABl"),
         new CompilerError("bla,", 0, 3, "1234", "BlabBlablABl"),
         new CompilerError("bla,", 0, 4, "1234", "BlabBlablABl")
     };
     _exception = new TextTransformationException(Message, _errors, TemplateClass);
 }
示例#3
0
        public void TestInitialized()
        {
            var converter = new Mock <IFormatterConverter>();

            _info = new SerializationInfo(typeof(TextTransformationException), converter.Object);

            _errors = new CompilerErrorCollection
            {
                new CompilerError("bla,", 0, 1, "1234", "BlabBlablABl"),
                new CompilerError("bla,", 0, 2, "1234", "BlabBlablABl"),
                new CompilerError("bla,", 0, 3, "1234", "BlabBlablABl"),
                new CompilerError("bla,", 0, 4, "1234", "BlabBlablABl")
            };

            var ex = new TextTransformationException(Message, _errors, TemplateClass);

            ex.GetObjectData(_info, new StreamingContext());
        }