public void AppDomainSetUpCorrect() { var context = new ServiceContext(); context.Add(new SettingsService()); var domainManager = new DomainManager(); context.Add(domainManager); context.ServiceManager.InitializeServices(); string mockDll = MockAssembly.AssemblyPath; var package = new TestPackage(mockDll); package.Settings["ShadowCopyFiles"] = true; AppDomainSetup setup = domainManager.CreateAppDomainSetup(package); Assert.That(setup.ApplicationName, Does.StartWith("Tests_")); Assert.That(setup.ApplicationBase, Is.SamePath(Path.GetDirectoryName(mockDll)), "ApplicationBase"); Assert.That( Path.GetFileName(setup.ConfigurationFile), Is.EqualTo("mock-nunit-assembly.exe.config").IgnoreCase, "ConfigurationFile"); Assert.AreEqual(null, setup.PrivateBinPath, "PrivateBinPath"); Assert.That(setup.ShadowCopyFiles, Is.EqualTo("true")); Assert.That(setup.ShadowCopyDirectories, Is.SamePath(Path.GetDirectoryName(mockDll)), "ShadowCopyDirectories"); }
public void AppDomainDefaultsToNotShadowCopy() { var context = new ServiceContext(); context.Add(new SettingsService()); var domainManager = new DomainManager(); context.Add(domainManager); context.ServiceManager.InitializeServices(); string mockDll = MockAssembly.AssemblyPath; AppDomainSetup setup = domainManager.CreateAppDomainSetup(new TestPackage(mockDll)); Assert.That(setup.ShadowCopyFiles, Is.Null.Or.EqualTo("false")); }
public void AppDomainSetUpCorrect() { ServiceContext context = new ServiceContext(); context.Add(new SettingsService()); var domainManager = new DomainManager(); context.Add(domainManager); context.ServiceManager.InitializeServices(); string mockDll = MockAssembly.AssemblyPath; AppDomainSetup setup = domainManager.CreateAppDomainSetup(new TestPackage(mockDll)); Assert.That(setup.ApplicationName, Does.StartWith("Tests_")); Assert.That(setup.ApplicationBase, Is.SamePath(Path.GetDirectoryName(mockDll)), "ApplicationBase"); Assert.That( Path.GetFileName( setup.ConfigurationFile ), Is.EqualTo("mock-nunit-assembly.dll.config").IgnoreCase, "ConfigurationFile"); Assert.AreEqual( null, setup.PrivateBinPath, "PrivateBinPath" ); Assert.That(setup.ShadowCopyDirectories, Is.SamePath(Path.GetDirectoryName(mockDll)), "ShadowCopyDirectories" ); }