예제 #1
0
        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);
        }
예제 #2
0
        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);
        }