public void Constructor3_Message_Null () { ArithmeticException ame = new ArithmeticException ("something"); BadImageFormatException bif = new BadImageFormatException ((string) null, ame); Assert.IsNotNull (bif.Data, "#1"); Assert.IsNull (bif.FileName, "#2"); Assert.IsNotNull (bif.InnerException, "#3"); Assert.AreSame (ame, bif.InnerException, "#4"); Assert.IsNotNull (bif.Message, "#5"); // Could not load file or assembly '' ... Assert.IsTrue (bif.Message.IndexOf ("''") != -1, "#6"); Assert.IsNull (bif.FusionLog, "#7"); Assert.IsTrue (bif.ToString ().StartsWith (bif.GetType ().FullName), "#8"); Assert.IsTrue (bif.ToString ().IndexOf ("---> " + ame.GetType ().FullName) != -1, "#9"); Assert.IsFalse (bif.ToString ().IndexOf (Environment.NewLine) != -1, "#10"); }
public void Constructor3 () { ArithmeticException ame = new ArithmeticException ("something"); FileNotFoundException fnf = new FileNotFoundException ("message", ame); Assert.IsNotNull (fnf.Data, "#1"); Assert.IsNull (fnf.FileName, "#2"); Assert.IsNotNull (fnf.InnerException, "#3"); Assert.AreSame (ame, fnf.InnerException, "#4"); Assert.IsNotNull (fnf.Message, "#5"); Assert.AreEqual ("message", fnf.Message, "#6"); Assert.IsNull (fnf.FusionLog, "#7"); Assert.AreEqual (fnf.GetType ().FullName + ": message ---> " + ame.GetType ().FullName + ": something", fnf.ToString (), "#8"); }
public void Constructor3_Message_Empty () { ArithmeticException ame = new ArithmeticException ("something"); BadImageFormatException bif = new BadImageFormatException (string.Empty, ame); Assert.IsNotNull (bif.Data, "#1"); Assert.IsNull (bif.FileName, "#2"); Assert.IsNotNull (bif.InnerException, "#3"); Assert.AreSame (ame, bif.InnerException, "#4"); Assert.IsNotNull (bif.Message, "#5"); Assert.AreEqual (string.Empty, bif.Message, "#6"); Assert.IsNull (bif.FusionLog, "#7"); Assert.AreEqual (bif.GetType ().FullName + ": ---> " + ame.GetType ().FullName + ": something", bif.ToString (), "#8"); }
public void Constructor3_Message_Null () { ArithmeticException ame = new ArithmeticException ("something"); FileNotFoundException fnf = new FileNotFoundException ((string) null, ame); #if NET_2_0 Assert.IsNotNull (fnf.Data, "#1"); #endif Assert.IsNull (fnf.FileName, "#2"); Assert.IsNotNull (fnf.InnerException, "#3"); Assert.AreSame (ame, fnf.InnerException, "#4"); #if NET_2_0 Assert.IsNull (fnf.Message, "#5"); #else Assert.IsNotNull (fnf.Message, "#5"); // File or assembly name (null), or ... #endif Assert.IsNull (fnf.FusionLog, "#6"); #if NET_2_0 #if TARGET_JVM Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": ---> " + ame.GetType().FullName + ": something"), "#7"); #else Assert.AreEqual (fnf.GetType ().FullName + ": ---> " + ame.GetType ().FullName + ": something", fnf.ToString (), "#7"); #endif #else Assert.IsTrue (fnf.ToString ().StartsWith (fnf.GetType ().FullName), "#7"); Assert.IsFalse (fnf.ToString ().IndexOf (Environment.NewLine) != -1, "#9"); #endif }
public void Constructor3_Message_Empty () { ArithmeticException ame = new ArithmeticException ("something"); FileNotFoundException fnf = new FileNotFoundException (string.Empty, ame); #if NET_2_0 Assert.IsNotNull (fnf.Data, "#1"); #endif Assert.IsNull (fnf.FileName, "#2"); Assert.IsNotNull (fnf.InnerException, "#3"); Assert.AreSame (ame, fnf.InnerException, "#4"); Assert.IsNotNull (fnf.Message, "#5"); Assert.AreEqual (string.Empty, fnf.Message, "#6"); Assert.IsNull (fnf.FusionLog, "#7"); #if TARGET_JVM Assert.IsTrue(fnf.ToString().StartsWith(fnf.GetType().FullName + ": ---> " + ame.GetType().FullName + ": something"), "#8"); #else Assert.AreEqual (fnf.GetType ().FullName + ": ---> " + ame.GetType ().FullName + ": something", fnf.ToString (), "#8"); #endif }
public void Constructor3_Message_Null () { 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"); #if !TARGET_JVM // ToString always has a stack trace under TARGET_JVM Assert.IsFalse (bif.ToString ().IndexOf (Environment.NewLine) != -1, "#10"); #endif // TARGET_JVM }
public void Constructor3_Message_Empty () { 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"); Assert.IsNotNull (bif.Message, "#5"); Assert.AreEqual (string.Empty, bif.Message, "#6"); Assert.IsNull (bif.FusionLog, "#7"); #if TARGET_JVM // ToString always has a stack trace under TARGET_JVM Assert.IsTrue (bif.ToString ().IndexOf (ame.GetType ().FullName + ": something") != -1, "#8"); #else Assert.AreEqual (bif.GetType ().FullName + ": ---> " + ame.GetType ().FullName + ": something", bif.ToString (), "#8"); #endif // TARGET_JVM }