예제 #1
0
        public void WhenNoOptionsAreSpecified_PackageContainsNoSettings()
        {
            var options = new ConsoleOptions("test.dll");
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.AreEqual(0, package.Settings.Count);
        }
예제 #2
0
        public void WhenX86IsSpecified_PackageIncludesIt()
        {
            var options = new ConsoleOptions("test.dll", "--x86");
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.IsTrue(package.GetSetting("RunAsX86", false));
        }
예제 #3
0
        public void WhenNoOptionsAreSpecified_PackageContainsOnlyTwoSettings()
        {
            var options = ConsoleMocks.Options("test.dll");
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.That(package.Settings.Keys, Is.EquivalentTo(new string[] { "WorkDirectory", "DisposeRunners" }));
        }
예제 #4
0
        public void WhenDisposeIsSpecified_PackageIncludesIt()
        {
            var options = new ConsoleOptions("test.dll", "--dispose-runners");
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.IsTrue(package.GetSetting("DisposeRunners", false));
        }
예제 #5
0
        public void WhenWorkersIsSpecified_PackageIncludesIt()
        {
            var options = new ConsoleOptions("test.dll", "--workers=3");
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.That(package.Settings.ContainsKey("NumberOfTestWorkers"));
            Assert.AreEqual(3, package.Settings["NumberOfTestWorkers"]);
        }
예제 #6
0
        public void WhenSeedIsSpecified_PackageIncludesIt()
        {
            var options = new ConsoleOptions("test.dll", "--seed=1234");
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.That(package.Settings.ContainsKey("RandomSeed"));
            Assert.AreEqual(1234, package.Settings["RandomSeed"]);
        }
예제 #7
0
        public void WhenTraceIsSpecified_PackageIncludesIt()
        {
            var options = new ConsoleOptions("test.dll", "--trace=Error");
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.That(package.Settings.ContainsKey("InternalTraceLevel"));
            Assert.AreEqual("Error", package.Settings["InternalTraceLevel"]);
        }
예제 #8
0
        public void WhenDebugging_NumberOfTestWorkersDefaultsToZero()
        {
            var options = ConsoleMocks.Options("test.dll", "--debug");
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.That(package.Settings["DebugTests"], Is.EqualTo(true));
            Assert.That(package.Settings["NumberOfTestWorkers"], Is.EqualTo(0));
        }
예제 #9
0
        public void SingleAssembly()
        {
            var options = ConsoleMocks.Options("test.dll");
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.That(package.SubPackages.Count, Is.EqualTo(1));
            Assert.That(package.SubPackages[0].FullName, Is.EqualTo(Path.GetFullPath("test.dll")));
        }
예제 #10
0
        public void WhenOptionIsSpecified_PackageIncludesSetting(string option, string key, object val)
        {
            var options = new ConsoleOptions("test.dll", option);
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.That(package.Settings.ContainsKey(key), "Setting not included for {0}", option);
            Assert.AreEqual(val, package.Settings[key], "NumberOfTestWorkers not set correctly for {0}", option);
        }
예제 #11
0
        public void WhenDebugging_NumberOfTestWorkersMayBeOverridden()
        {
            var options = ConsoleMocks.Options("test.dll", "--debug", "--workers=3");
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.That(package.Settings["DebugTests"], Is.EqualTo(true));
            Assert.That(package.Settings["NumberOfTestWorkers"], Is.EqualTo(3));
        }
예제 #12
0
        public void SingleAssembly()
        {
            var options = new ConsoleOptions("test.dll");
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.AreEqual(1, package.SubPackages.Count);
            Assert.AreEqual(Path.GetFullPath("test.dll"), package.SubPackages[0].FullName);
        }
예제 #13
0
        public void WhenConfigIsSpecified_PackageIncludesIt()
        {
            var options = new ConsoleOptions("test.dll", "--config=Release");
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.That(package.Settings.ContainsKey("ActiveConfig"));
            Assert.AreEqual("Release", package.Settings["ActiveConfig"]);
        }
예제 #14
0
        public void WhenNoOptionsAreSpecified_PackageContainsWorkDirectorySettingOnly()
        {
            var options = new ConsoleOptions("test.dll");
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.AreEqual(1, package.Settings.Count);
            Assert.That(package.Settings.Keys, Contains.Item("WorkDirectory"));
        }
예제 #15
0
        public void WhenFrameworkIsSpecified_PackageIncludesIt()
        {
            var options = new ConsoleOptions("test.dll", "--framework=net-4.0");
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.That(package.Settings.ContainsKey("RuntimeFramework"));
            Assert.AreEqual("net-4.0", package.Settings["RuntimeFramework"]);
        }
예제 #16
0
        public void WhenDomainUsageIsSpecified_PackageIncludesIt()
        {
            var options = new ConsoleOptions("test.dll", "--domain=Multiple");
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.That(package.Settings.ContainsKey("DomainUsage"));
            Assert.AreEqual("Multiple", package.Settings["DomainUsage"]);
        }
예제 #17
0
        public void WhenProcessModelIsSpecified_PackageIncludesIt()
        {
            var options = new ConsoleOptions("test.dll", "--process=Separate");
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.That(package.Settings.ContainsKey("ProcessModel"));
            Assert.AreEqual("Separate", package.Settings["ProcessModel"]);
        }
예제 #18
0
        public void WhenTimeoutIsSpecified_PackageIncludesIt()
        {
            var options = new ConsoleOptions("test.dll", "--timeout=50");
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.That(package.Settings.ContainsKey("DefaultTimeout"));
            Assert.AreEqual(50, package.Settings["DefaultTimeout"]);
        }
예제 #19
0
        public void MultipleAssemblies()
        {
            var names   = new [] { "test1.dll", "test2.dll", "test3.dll" };
            var options = new ConsoleOptions(names);
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.AreEqual(3, package.SubPackages.Count);
            Assert.AreEqual(Path.GetFullPath("test1.dll"), package.SubPackages[0].FullName);
            Assert.AreEqual(Path.GetFullPath("test2.dll"), package.SubPackages[1].FullName);
            Assert.AreEqual(Path.GetFullPath("test3.dll"), package.SubPackages[2].FullName);
        }
예제 #20
0
        public void MultipleAssemblies()
        {
            var names   = new [] { "test1.dll", "test2.dll", "test3.dll" };
            var options = ConsoleMocks.Options(names);
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.That(package.SubPackages.Count, Is.EqualTo(3));
            Assert.That(package.SubPackages[0].FullName, Is.EqualTo(Path.GetFullPath("test1.dll")));
            Assert.That(package.SubPackages[1].FullName, Is.EqualTo(Path.GetFullPath("test2.dll")));
            Assert.That(package.SubPackages[2].FullName, Is.EqualTo(Path.GetFullPath("test3.dll")));
        }
예제 #21
0
        public void MultipleAssemblies()
        {
            var names    = new [] { "test1.dll", "test2.dll", "test3.dll" };
            var expected = new[] {
                Path.GetFullPath("test1.dll"),
                Path.GetFullPath("test2.dll"),
                Path.GetFullPath("test3.dll")
            };
            var options = new ConsoleOptions(names);
            var package = ConsoleRunner.MakeTestPackage(options);

            Assert.AreEqual(expected, package.TestFiles);
        }