コード例 #1
0
ファイル: TestPackage.cs プロジェクト: dougrathbone/mbunit-v3
        /// <summary>
        /// Creates a host setup based on the package properties.
        /// </summary>
        /// <returns>The host setup.</returns>
        public HostSetup CreateHostSetup()
        {
            var hostSetup = new HostSetup
            {
                DebuggerSetup = DebuggerSetup,
                ShadowCopy = ShadowCopy,
                ApplicationBaseDirectory = ApplicationBaseDirectory != null ? ApplicationBaseDirectory.FullName : null,
                WorkingDirectory = WorkingDirectory != null ? WorkingDirectory.FullName : null,
                RuntimeVersion = RuntimeVersion
            };

            GenericCollectionUtils.ForEach(Properties, x => hostSetup.AddProperty(x.Key, x.Value));
            GenericCollectionUtils.ForEach(HintDirectories, x => hostSetup.AddHintDirectory(x.FullName));
            return hostSetup;
        }
コード例 #2
0
        /// <summary>
        /// Sets the part cover coverage file.
        /// </summary>
        /// <param name="hostSetup">The host setup.</param>
        /// <param name="partCoverCoverageFile">The part cover coverage file.</param>
        internal static void SetPartCoverCoverageFile(HostSetup hostSetup, string partCoverCoverageFile)
        {
            if (hostSetup == null)
                throw new ArgumentNullException("hostSetup");

            hostSetup.RemoveProperty("PartCoverCoverageFile");
            hostSetup.AddProperty("PartCoverCoverageFile", partCoverCoverageFile);
        }
コード例 #3
0
ファイル: NCoverHost.cs プロジェクト: dougrathbone/mbunit-v3
 internal static void SetNCoverCoverageFile(HostSetup hostSetup, string ncoverCoverageFile)
 {
     hostSetup.RemoveProperty("NCoverCoverageFile");
     hostSetup.AddProperty("NCoverCoverageFile", ncoverCoverageFile);
 }
コード例 #4
0
        public void Copy()
        {
            HostSetup setup = new HostSetup
            {
                ApplicationBaseDirectory = @"C:\AppBase",
                Configuration = { ConfigurationXml = "<xml/>" },
                ConfigurationFileLocation = ConfigurationFileLocation.AppBase,
                ProcessorArchitecture = ProcessorArchitecture.Amd64,
                ShadowCopy = true,
                DebuggerSetup = new DebuggerSetup(),
                RuntimeVersion = "2.0.50727",
                Elevated = true,
                WorkingDirectory = @"C:\WorkingDir",
            };
            setup.AddHintDirectory("Abc");
            setup.AddProperty("abc", "def");

            HostSetup copy = setup.Copy();

            Assert.AreEqual(setup.ApplicationBaseDirectory, copy.ApplicationBaseDirectory);
            Assert.AreEqual(setup.Configuration.ConfigurationXml, copy.Configuration.ConfigurationXml);
            Assert.AreEqual(setup.ConfigurationFileLocation, copy.ConfigurationFileLocation);
            Assert.AreEqual(setup.ProcessorArchitecture, copy.ProcessorArchitecture);
            Assert.AreEqual(setup.ShadowCopy, copy.ShadowCopy);
            Assert.AreEqual(setup.Elevated, copy.Elevated);
            Assert.IsNotNull(copy.DebuggerSetup);
            Assert.AreEqual(setup.RuntimeVersion, copy.RuntimeVersion);
            Assert.AreEqual(setup.WorkingDirectory, copy.WorkingDirectory);
            Assert.AreEqual(setup.HintDirectories, copy.HintDirectories);
            Assert.AreEqual(setup.Properties, copy.Properties);
        }