{
BadImageFormatException bif = new BadImageFormatException ();
-#if NET_2_0
Assert.IsNotNull (bif.Data, "#1");
-#endif
Assert.IsNull (bif.FileName, "#2");
Assert.IsNull (bif.InnerException, "#3");
Assert.IsNotNull (bif.Message, "#4"); // Format of the executable (.exe) or library (.dll) is invalid
{
BadImageFormatException bif = new BadImageFormatException ("message");
-#if NET_2_0
Assert.IsNotNull (bif.Data, "#1");
-#endif
Assert.IsNull (bif.FileName, "#2");
Assert.IsNull (bif.InnerException, "#3");
Assert.IsNotNull (bif.Message, "#4");
{
BadImageFormatException bif = new BadImageFormatException (string.Empty);
-#if NET_2_0
Assert.IsNotNull (bif.Data, "#1");
-#endif
Assert.IsNull (bif.FileName, "#2");
Assert.IsNull (bif.InnerException, "#3");
Assert.IsNotNull (bif.Message, "#4");
{
BadImageFormatException bif = new BadImageFormatException ((string) null);
-#if NET_2_0
Assert.IsNotNull (bif.Data, "#1");
-#endif
Assert.IsNull (bif.FileName, "#2");
Assert.IsNull (bif.InnerException, "#3");
-#if NET_2_0
Assert.IsNotNull (bif.Message, "#4"); // Could not load file or assembly '' ...
Assert.IsTrue (bif.Message.IndexOf ("''") != -1, "#5");
-#else
- Assert.IsNotNull (bif.Message, "#4"); // Format of the executable (.exe) or library ...
- Assert.IsFalse (bif.Message.IndexOf ("''") != -1, "#5");
-#endif
Assert.IsNull (bif.FusionLog, "#5");
Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType ().FullName), "#6");
-#if NET_2_0
Assert.IsTrue (bif.ToString ().IndexOf ("''") != -1, "#7");
-#else
- Assert.IsFalse (bif.ToString ().IndexOf ("''") != -1, "#7");
-#endif
}
[Test]
BadImageFormatException bif = new BadImageFormatException ("message",
ame);
-#if NET_2_0
Assert.IsNotNull (bif.Data, "#1");
-#endif
Assert.IsNull (bif.FileName, "#2");
Assert.IsNotNull (bif.InnerException, "#3");
Assert.AreSame (ame, bif.InnerException, "#4");
ArithmeticException ame = new ArithmeticException ("something");
BadImageFormatException bif = new BadImageFormatException (string.Empty, ame);
-#if NET_2_0
Assert.IsNotNull (bif.Data, "#1");
-#endif
Assert.IsNull (bif.FileName, "#2");
Assert.IsNotNull (bif.InnerException, "#3");
Assert.AreSame (ame, bif.InnerException, "#4");
ArithmeticException ame = new ArithmeticException ("something");
BadImageFormatException bif = new BadImageFormatException ((string) null, ame);
-#if NET_2_0
Assert.IsNotNull (bif.Data, "#1");
-#endif
Assert.IsNull (bif.FileName, "#2");
Assert.IsNotNull (bif.InnerException, "#3");
Assert.AreSame (ame, bif.InnerException, "#4");
-#if NET_2_0
Assert.IsNotNull (bif.Message, "#5"); // Could not load file or assembly '' ...
Assert.IsTrue (bif.Message.IndexOf ("''") != -1, "#6");
-#else
- Assert.IsNotNull (bif.Message, "#5"); // Format of the executable (.exe) or library ...
- Assert.IsFalse (bif.Message.IndexOf ("''") != -1, "#6");
-#endif
Assert.IsNull (bif.FusionLog, "#7");
Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType ().FullName), "#8");
Assert.IsTrue (bif.ToString ().IndexOf ("---> " + ame.GetType ().FullName) != -1, "#9");
BadImageFormatException bif = new BadImageFormatException ("message",
(Exception) null);
-#if NET_2_0
Assert.IsNotNull (bif.Data, "#1");
-#endif
Assert.IsNull (bif.FileName, "#2");
Assert.IsNull (bif.InnerException, "#3");
Assert.IsNotNull (bif.Message, "#4");
BadImageFormatException bif = new BadImageFormatException ("message",
"file.txt");
-#if NET_2_0
Assert.IsNotNull (bif.Data, "#1");
-#endif
Assert.IsNotNull (bif.FileName, "#2");
Assert.AreEqual ("file.txt", bif.FileName, "#3");
Assert.IsNull (bif.InnerException, "#4");
Assert.IsNull (bif.FusionLog, "#7");
Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType ().FullName
+ ": message" + Environment.NewLine), "#8");
-#if NET_2_0
Assert.IsTrue (bif.ToString ().IndexOf ("'file.txt'") != -1, "#9");
Assert.IsFalse (bif.ToString ().IndexOf ("\"file.txt\"") != -1, "#9");
-#else
- Assert.IsFalse (bif.ToString ().IndexOf ("'file.txt'") != -1, "#9");
- Assert.IsTrue (bif.ToString ().IndexOf ("\"file.txt\"") != -1, "#10");
-#endif
}
[Test]
BadImageFormatException bif = new BadImageFormatException ("message",
string.Empty);
-#if NET_2_0
Assert.IsNotNull (bif.Data, "#1");
-#endif
Assert.IsNotNull (bif.FileName, "#2");
Assert.AreEqual (string.Empty, bif.FileName, "#3");
Assert.IsNull (bif.InnerException, "#4");
BadImageFormatException bif = new BadImageFormatException ("message",
(string) null);
-#if NET_2_0
Assert.IsNotNull (bif.Data, "#A1");
-#endif
Assert.IsNull (bif.FileName, "#A2");
Assert.IsNull (bif.InnerException, "#A3");
Assert.IsNotNull (bif.Message, "#A4");
bif = new BadImageFormatException (string.Empty, (string) null);
-#if NET_2_0
Assert.IsNotNull (bif.Data, "#B1");
-#endif
Assert.IsNull (bif.FileName, "#B2");
Assert.IsNull (bif.InnerException, "#B3");
Assert.IsNotNull (bif.Message, "#B4");
BadImageFormatException bif = new BadImageFormatException (string.Empty,
string.Empty);
-#if NET_2_0
Assert.IsNotNull (bif.Data, "#1");
-#endif
Assert.IsNotNull (bif.FileName, "#2");
Assert.AreEqual (string.Empty, bif.FileName, "#3");
Assert.IsNull (bif.InnerException, "#4");
BadImageFormatException bif = new BadImageFormatException ((string) null,
(string) null);
-#if NET_2_0
Assert.IsNotNull (bif.Data, "#1");
-#endif
Assert.IsNull (bif.FileName, "#2");
Assert.IsNull (bif.InnerException, "#3");
-#if NET_2_0
Assert.IsNotNull (bif.Message, "#4"); // Could not load file or assembly '' ...
Assert.IsTrue (bif.Message.IndexOf ("''") != -1, "#5");
-#else
- Assert.IsNotNull (bif.Message, "#4"); // Format of the executable (.exe) or library ...
- Assert.IsFalse (bif.Message.IndexOf ("''") != -1, "#5");
-#endif
Assert.IsNull (bif.FusionLog, "#5");
Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType ().FullName
+ ": "), "#6");
bif = new BadImageFormatException (string.Empty, "file.txt");
-#if NET_2_0
Assert.IsNotNull (bif.Data, "#1");
-#endif
Assert.IsNotNull (bif.FileName, "#2");
Assert.AreEqual ("file.txt", bif.FileName, "#3");
Assert.IsNull (bif.InnerException, "#4");
Assert.IsNull (bif.FusionLog, "#7");
Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType ().FullName
+ ": " + Environment.NewLine), "#8");
-#if NET_2_0
Assert.IsTrue (bif.ToString ().IndexOf ("'file.txt'") != -1, "#9");
Assert.IsFalse (bif.ToString ().IndexOf ("\"file.txt\"") != -1, "#10");
-#else
- Assert.IsFalse (bif.ToString ().IndexOf ("'file.txt'") != -1, "#9");
- Assert.IsTrue (bif.ToString ().IndexOf ("\"file.txt\"") != -1, "#10");
-#endif
}
[Test]
bif = new BadImageFormatException ((string) null, "file.txt");
-#if NET_2_0
Assert.IsNotNull (bif.Data, "#A1");
-#endif
Assert.IsNotNull (bif.FileName, "#A2");
Assert.AreEqual ("file.txt", bif.FileName, "#A3");
Assert.IsNull (bif.InnerException, "#A4");
bif = new BadImageFormatException ((string) null, string.Empty);
-#if NET_2_0
Assert.IsNotNull (bif.Data, "#B1");
-#endif
Assert.IsNotNull (bif.FileName, "#B2");
Assert.AreEqual (string.Empty, bif.FileName, "#B3");
Assert.IsNull (bif.InnerException, "#B4");