The AutoRun class is used by executable test assemblies to control their own execution. Call it from your executable test like this: new AutoRun().Execute(args); The arguments can be those passed into your exe or constructed for the purpose in your code. If the tests are in a dll, you can write a stub executable that runs them like this: new Autorun().Execute(testAssembly, args); When running tests compiled against the portable framework, the methods above are not available. Run your tests like this: new AutoRun().Execute(testAssembly, args, output, input); Where output is an ExtendedTextWriter (normally a ColorConsoleWriter) and input is usually Console.In and is used by the --wait option.
Пример #1
0
        public static int Main(string[] args)
        {
            var res = new AutoRun(typeof(Program).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);

            Console.WriteLine("\n\nPress any key...");
            Console.ReadKey();
            return res;
        }
Пример #2
0
		public static int Main(string[] args)
		{
			int result = new AutoRun(typeof(Program).GetTypeInfo().Assembly)
				.Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);
			Console.ReadKey();

			return result;
		}
Пример #3
0
 public static int Main(string[] args)
 {
     var execute = new AutoRun(typeof(Startup).GetTypeInfo().Assembly)
         .Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);
     Console.WriteLine("Press enter to exit...");
     Console.ReadLine();
     return execute;
 }
Пример #4
0
        /// <summary>
        /// The entry point of the program, where the program control starts and ends.
        /// </summary>
        /// <param name='args'>
        /// The command-line arguments.
        /// </param>
        public static int Main(string[] args)
        {
            var autoRun = new AutoRun(typeof(MainClass).GetTypeInfo().Assembly);

            #if DNX451
                    autoRun.Execute(args);
            #else
                    autoRun.Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);
            #endif

            return 0;
        }
Пример #5
0
        /// <summary>
        /// The main program executes the tests. Output may be routed to
        /// various locations, depending on the arguments passed.
        /// </summary>
        /// <remarks>Run with --help for a full list of arguments supported</remarks>
        /// <param name="args"></param>
        public static int Main(string[] args)
        {
            var licenseKey = Environment.GetEnvironmentVariable("SERVICESTACK_LICENSE");
            if (licenseKey.IsNullOrEmpty())
                throw new ArgumentNullException("SERVICESTACK_LICENSE", "Add Environment variable for SERVICESTACK_LICENSE");

            Licensing.RegisterLicense(licenseKey);
            //"ActivatedLicenseFeatures: ".Print(LicenseUtils.ActivatedLicenseFeatures());

    	    CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US");
            JsConfig.InitStatics();
            //JsonServiceClient client = new JsonServiceClient();
            var writer = new ExtendedTextWrapper(Console.Out);
            var result = new AutoRun(((IReflectableType)typeof(NetCoreTestsRunner)).GetTypeInfo().Assembly).Execute(args, writer, Console.In);

#if DEBUG
            "Press Any Key to Quit.".Print();
            Console.Read();
#endif
            return result;
        }