Ejemplo n.º 1
0
        public void Something_that_is_in_same_AppDomain_should_be_callable_indirectly()
        {
            AppDomain.CurrentDomain.RunAtIsolatedDomain(() =>
            {
                using (new IndirectionsContext())
                {
                    // Arrange
                    PAppDomainSomething.Do().Body = () => { };

                    // Act, Assert
                    ExceptionAssert.DoesNotThrow(() => AppDomainSomething.Do());
                }
            });
        }
Ejemplo n.º 2
0
        public void Something_that_is_cross_plural_AppDomains_should_not_be_callable_indirectly()
        {
            using (new IndirectionsContext())
            {
                // Arrange
                PAppDomainSomething.Do().Body = () => { };
            }

            AppDomain.CurrentDomain.RunAtIsolatedDomain(() =>
            {
                using (new IndirectionsContext())
                {
                    // Act, Assert
                    ExceptionAssert.Throws <InvalidOperationException>(() => AppDomainSomething.Do());
                }
            });
        }
Ejemplo n.º 3
0
        public void Something_that_is_cross_plural_AppDomains_should_be_handled_as_different_setup()
        {
            lock (AppDomainMixin.SyncRoot)
            {
                AppDomain.CurrentDomain.RunAtIsolatedDomain(() =>
                {
                    using (new IndirectionsContext())
                    {
                        // Arrange
                        PAppDomainSomething.Do().Body = () => { };
                    }
                });

                AppDomain.CurrentDomain.RunAtIsolatedDomain(() =>
                {
                    using (new IndirectionsContext())
                    {
                        // Act, Assert
                        ExceptionAssert.Throws <InvalidOperationException>(() => AppDomainSomething.Do());
                    }
                });
            }
        }