Esempio n. 1
0
        public void GeneratesVerifiableIL()
        {
            AppDomain spawnedDomain = CreateRestrictedDomain("spawned");

            try
            {
                UnityProxy proxy = (UnityProxy)spawnedDomain.CreateInstanceAndUnwrap(typeof(UnityProxy).Assembly.FullName, typeof(UnityProxy).FullName);
                Assert.IsTrue(proxy.CreateSomething());
            }
            finally
            {
                AppDomain.Unload(spawnedDomain);
            }
        }
        public void GeneratesVerifiableIL()
        {
            AppDomain spawnedDomain = CreateRestrictedDomain("spawned");

            try
            {
                UnityProxy proxy = (UnityProxy)spawnedDomain.CreateInstanceAndUnwrap(typeof(UnityProxy).Assembly.FullName, typeof(UnityProxy).FullName);
                Assert.IsTrue(proxy.CreateSomething());
            }
            catch (Exception ex)
            {
                Assert.Fail(string.Format("Exception of type {0} was caught, message {1}", ex.GetType(), ex.Message));
            }
            finally
            {
                AppDomain.Unload(spawnedDomain);
            }
        }