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