public void MediumTrustAllowsCopyingBetweenTypesFromSameModule() { SampleBaseClass i1 = new SampleDerivedClass("1st config val"); SampleBaseClass i2 = new SampleFurtherDerivedClass("2nd config val"); SecurityTemplate.MediumTrustInvoke(new ThreadStart(new CopyCommand(i2, i1).Execute)); Assert.AreEqual(i1, i2); }
public void TestBaseTypeAllowed() { SampleBaseClass i1 = new SampleDerivedClass("1st config val"); SampleBaseClass i2 = new SampleFurtherDerivedClass("2nd config val"); ReflectionUtils.MemberwiseCopy(i2, i1); Assert.AreEqual(i1, i2); }