public void Create_WillReturnLoaderInstance_Always()
        {
            var factory = new Fake_LoaderFactory();

            ILoader loader = factory.Create();

            Assert.IsTrue(loader != null);
            AppDomain.Unload(factory.LoaderDomain);
        }
        public void Create_WillReturnLoaderInstance_Always()
        {
            var factory = new Fake_LoaderFactory();

            ILoader loader = factory.Create();

            Assert.IsTrue(loader != null);
            AppDomain.Unload(factory.LoaderDomain);
        }
        public void Create_WillCreateLoaderInsideSeparateAppDomain_Always()
        {
            var factory = new Fake_LoaderFactory();

            ILoader loader = factory.Create();

            int appDomainId = Fake_LoaderFactory.GetObjectAppDomainId(loader);
            Assert.AreEqual(factory.LoaderDomain.Id, appDomainId);
            AppDomain.Unload(factory.LoaderDomain);
        }
        public void Create_WillCreateSeparateAppDomainWithShadowCopy_Always()
        {
            var factory = new Fake_LoaderFactory();

            ILoader loader = factory.Create();

            Assert.AreEqual("true", factory.AppDomainSetupUsed.ShadowCopyFiles);
            Assert.IsTrue(factory.LoaderDomain != null);
            Assert.IsFalse(factory.LoaderDomain.IsDefaultAppDomain());
            AppDomain.Unload(factory.LoaderDomain);
        }
        public void Create_WillCreateLoaderInsideSeparateAppDomain_Always()
        {
            var factory = new Fake_LoaderFactory();

            ILoader loader = factory.Create();

            int appDomainId = Fake_LoaderFactory.GetObjectAppDomainId(loader);

            Assert.AreEqual(factory.LoaderDomain.Id, appDomainId);
            AppDomain.Unload(factory.LoaderDomain);
        }
        public void Create_WillCreateSeparateAppDomainWithShadowCopy_Always()
        {
            var factory = new Fake_LoaderFactory();

            ILoader loader = factory.Create();

            Assert.AreEqual("true", factory.AppDomainSetupUsed.ShadowCopyFiles);
            Assert.IsTrue(factory.LoaderDomain != null);
            Assert.IsFalse(factory.LoaderDomain.IsDefaultAppDomain());
            AppDomain.Unload(factory.LoaderDomain);
        }
        public void Create_WillLoadCiderAssemblyIntoSeparateAppDomain_Always()
        {
            var factory = new Fake_LoaderFactory();

            ILoader loader = factory.Create();

            var domainAssemblies = factory.LoaderDomain.GetAssemblies();
            var ciderAssembly = (from assembly in domainAssemblies.AsQueryable()
                                 where assembly.ToString().StartsWith("Cider-x64, Version=")
                                 select assembly).FirstOrDefault();
            Assert.IsTrue(ciderAssembly != null);
            AppDomain.Unload(factory.LoaderDomain);
        }
        public void Create_WillLoadCiderAssemblyIntoSeparateAppDomain_Always()
        {
            var factory = new Fake_LoaderFactory();

            ILoader loader = factory.Create();

            var domainAssemblies = factory.LoaderDomain.GetAssemblies();
            var ciderAssembly    = (from assembly in domainAssemblies.AsQueryable()
                                    where assembly.ToString().StartsWith("Cider-x64, Version=")
                                    select assembly).FirstOrDefault();

            Assert.IsTrue(ciderAssembly != null);
            AppDomain.Unload(factory.LoaderDomain);
        }