public void TestAsClass() { var obj = TestClassWithCtor.ExampleInstance; var newObj = new TestClassWithCtor(obj, false); Assert.IsTrue(obj.FieldA == newObj.FieldA); Assert.IsTrue(obj.PropA == newObj.PropA); Assert.IsTrue(obj.PropB == newObj.PropB); Assert.IsTrue(obj.PropC == newObj.PropC); Assert.IsTrue(newObj.VirtA == null); var newObjWithVirt = new TestClassWithCtor(obj, true); Assert.IsTrue(obj.FieldA == newObjWithVirt.FieldA); Assert.IsTrue(obj.PropA == newObjWithVirt.PropA); Assert.IsTrue(obj.PropB == newObjWithVirt.PropB); Assert.IsTrue(obj.PropC == newObjWithVirt.PropC); Assert.IsTrue(obj.VirtA == newObjWithVirt.VirtA); }
public static bool ClassWithCtorParam(TestClassWithCtor x) { return(x == null); }
public TestClassWithCtor(TestClassWithCtor @base, bool copyVirtual) { _copier(@base, this, copyVirtual); }