예제 #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);
        }