static void TestMovedVirtualMethods() { var o = new MyChildClass(); Assert.AreEqual(o.MovedToBaseClass(), "MovedToBaseClass"); Assert.AreEqual(o.ChangedToVirtual(), "ChangedToVirtual"); if (!LLILCJitEnabled) { o = null; try { o.MovedToBaseClass(); } catch (NullReferenceException) { try { o.ChangedToVirtual(); } catch (NullReferenceException) { return; } } Assert.AreEqual("NullReferenceException", "thrown"); } }
static void TestMovedVirtualMethods() { var o = new MyChildClass(); Assert.AreEqual(o.MovedToBaseClass(), "MovedToBaseClass"); Assert.AreEqual(o.ChangedToVirtual(), "ChangedToVirtual"); o = null; try { o.MovedToBaseClass(); } catch (NullReferenceException) { try { o.ChangedToVirtual(); } catch (NullReferenceException) { return; } } Assert.AreEqual("NullReferenceException", "thrown"); }
static void TestMovedVirtualMethods() { var o = new MyChildClass(); Assert.AreEqual(o.MovedToBaseClass(), "MovedToBaseClass"); Assert.AreEqual(o.ChangedToVirtual(), "ChangedToVirtual"); }
public MyClass() { Name = "Name"; Name2 = "Name2"; Name3 = "Name3"; Name4 = "Name4"; Name5 = "Name5"; ChildClass = new MyChildClass(); }
static void TestMovedVirtualMethodsOnNullReference() { MyChildClass o = null; try { o.MovedToBaseClass(); } catch (NullReferenceException) { try { o.ChangedToVirtual(); } catch (NullReferenceException) { return; } } Assert.AreEqual("NullReferenceException", "thrown"); }
public RootClass2() { Child = new MyChildClass(); }