示例#1
0
        public void WaitCommandWithPortThrowsArgumentException()
        {
            var ex = Assert.Throws <ArgumentException>(() => TestableCommandLine.Parse("assemblyName.dll", "-wait-command"));

            Assert.Equal("when specifing --wait-command you must also pass a port using --port", ex.Message);
        }
示例#2
0
        public void NoReporters_UsesDefaultReporter()
        {
            var commandLine = TestableCommandLine.Parse("assemblyName.dll");

            Assert.IsType <DefaultRunnerReporterWithTypes>(commandLine.Reporter);
        }
示例#3
0
        public static void ValidValues(string value, int expected)
        {
            var commandLine = TestableCommandLine.Parse("assemblyName.dll", "-port", value);

            Assert.Equal(expected, commandLine.Port);
        }
示例#4
0
        public void SetsMaxParallelThreads()
        {
            var commandLine = TestableCommandLine.Parse("assemblyName.dll", "-maxthreads", "16");

            Assert.Equal(16, commandLine.MaxParallelThreads);
        }
示例#5
0
        public static void ValidValues(string value, int expected)
        {
            var commandLine = TestableCommandLine.Parse("assemblyName.dll", "-maxthreads", value);

            Assert.Equal(expected, commandLine.MaxParallelThreads);
        }
示例#6
0
        public static void MissingValue()
        {
            var ex = Assert.Throws <ArgumentException>(() => TestableCommandLine.Parse("assemblyName.dll", "-maxthreads"));

            Assert.Equal("missing argument for -maxthreads", ex.Message);
        }
示例#7
0
        public void ParallelCanBeTurnedOn()
        {
            var project = TestableCommandLine.Parse("assemblyName.dll", "-parallel");

            Assert.True(project.Parallel);
        }
示例#8
0
        public static void ValidValues(string value, AppDomainSupport expected)
        {
            var commandLine = TestableCommandLine.Parse("assemblyName.dll", "-appdomains", value);

            Assert.Equal(expected, commandLine.AppDomains);
        }
示例#9
0
        public static void AssemblyFilePresentDoesNotThrow()
        {
            var arguments = new[] { "assemblyName.dll" };

            TestableCommandLine.Parse(arguments);  // Should not throw
        }
示例#10
0
        public static void DefaultValueIsNull()
        {
            var commandLine = TestableCommandLine.Parse("assemblyName.dll");

            Assert.Null(commandLine.AppDomains);
        }
示例#11
0
        public static void InvalidValue()
        {
            var ex = Assert.Throws <ArgumentException>(() => TestableCommandLine.Parse("assemblyName.dll", "-appdomains", "foo"));

            Assert.Equal("incorrect argument value for -appdomains (must be 'ifavailable', 'required', or 'denied')", ex.Message);
        }
示例#12
0
        public void NoReporters_UsesDefaultReporter()
        {
            var commandLine = TestableCommandLine.Parse("no-config.json");

            Assert.IsType <DefaultRunnerReporter>(commandLine.Reporter);
        }
示例#13
0
        public static void Unlimited_SetsToZero()
        {
            var commandLine = TestableCommandLine.Parse("assemblyName.dll", "-maxthreads", "unlimited");

            Assert.Equal(0, commandLine.MaxParallelThreads);
        }
示例#14
0
        public static void Default_SetsToNull()
        {
            var commandLine = TestableCommandLine.Parse("assemblyName.dll", "-maxthreads", "default");

            Assert.Null(commandLine.MaxParallelThreads);
        }
示例#15
0
        public static void DefaultValueIsFalse()
        {
            var commandLine = TestableCommandLine.Parse("assemblyName.dll");

            Assert.False(commandLine.WaitCommand);
        }
示例#16
0
        public void DefaultValueIsZero()
        {
            var commandLine = TestableCommandLine.Parse("assemblyName.dll");

            Assert.Equal(0, commandLine.MaxParallelThreads);
        }
示例#17
0
        public static void DefaultValueIsNull()
        {
            var commandLine = TestableCommandLine.Parse("assemblyName.dll");

            Assert.Null(commandLine.MaxParallelThreads);
        }
示例#18
0
        public void InvalidValue()
        {
            var ex = Assert.Throws <ArgumentException>(() => TestableCommandLine.Parse("assemblyName.dll", "-maxthreads", "abc"));

            Assert.Equal("incorrect argument value for -maxthreads", ex.Message);
        }
示例#19
0
        public static void InvalidValues(string value)
        {
            var ex = Assert.Throws <ArgumentException>(() => TestableCommandLine.Parse("assemblyName.dll", "-maxthreads", value));

            Assert.Equal("incorrect argument value for -maxthreads (must be 'default', 'unlimited', or a positive number)", ex.Message);
        }
示例#20
0
        public void ParallelIsOffByDefault()
        {
            var project = TestableCommandLine.Parse("assemblyName.dll");

            Assert.False(project.Parallel);
        }