コード例 #1
0
        void LoadTests()
        {
            runner = new WatchOSRunner();
            var categoryFilter = new NotFilter(new CategoryExpression("MobileNotWorking,NotOnMac,NotWorking,ValueAdd,CAS,InetAccess,NotWorkingInterpreter,RequiresBSDSockets").Filter);

            if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("NUNIT_FILTER_START")))
            {
                var firstChar  = Environment.GetEnvironmentVariable("NUNIT_FILTER_START") [0];
                var lastChar   = Environment.GetEnvironmentVariable("NUNIT_FILTER_END") [0];
                var nameFilter = new NameStartsWithFilter()
                {
                    FirstChar = firstChar, LastChar = lastChar
                };
                runner.Filter = new AndFilter(categoryFilter, nameFilter);
            }
            else
            {
                runner.Filter = categoryFilter;
            }
            runner.Add(GetType().Assembly);
            TestLoader.AddTestAssemblies(runner);
            ThreadPool.QueueUserWorkItem((v) =>
            {
                runner.LoadSync();
                BeginInvokeOnMainThread(() =>
                {
                    lblStatus.SetText(string.Format("{0} tests", runner.TestCount));
                    RenderResults();
                    cmdRun.SetEnabled(true);
                    cmdRun.SetHidden(false);

                    runner.AutoRun();
                });
            });
        }
コード例 #2
0
        void LoadTests()
        {
            var excludeCategories = new [] {
                "MobileNotWorking",
                "NotOnMac",
                "NotWorking",
                "ValueAdd",
                "CAS",
                "InetAccess",
                "NotWorkingLinqInterpreter",
                "RequiresBSDSockets",
                "BitcodeNotSupported",
            };

            runner = new WatchOSRunner();
            runner.ExcludedCategories = new HashSet <string> (excludeCategories);
            runner.Add(GetType().Assembly);
            TestLoader.AddTestAssemblies(runner);
            ThreadPool.QueueUserWorkItem((v) =>
            {
                runner.LoadSync();
                BeginInvokeOnMainThread(() =>
                {
                    lblStatus.SetText(string.Format("{0} tests", runner.TestCount));
                    RenderResults();
                    cmdRun.SetEnabled(true);
                    cmdRun.SetHidden(false);

                    runner.AutoRun();
                });
            });
        }
コード例 #3
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // create a new window instance based on the screen size
            window        = new UIWindow(UIScreen.MainScreen.Bounds);
            runner        = new TouchRunner(window);
            runner.Filter = new NotFilter(new CategoryExpression("MobileNotWorking,NotOnMac,NotWorking,ValueAdd,CAS,InetAccess,NotWorkingLinqInterpreter").Filter);

            // register every tests included in the main application/assembly
            runner.Add(System.Reflection.Assembly.GetExecutingAssembly());
            TestLoader.AddTestAssemblies(runner);

            window.RootViewController = new UINavigationController(runner.GetViewController());

            // make the window visible
            window.MakeKeyAndVisible();

            return(true);
        }