Inheritance: ITestListener
コード例 #1
0
		public override bool FinishedLaunching(UIApplication app, NSDictionary options)
		{
			global::Xamarin.Forms.Forms.Init();

			window = new UIWindow(UIScreen.MainScreen.Bounds);
			runner = new TouchRunner(window);
			runner.Add(System.Reflection.Assembly.GetExecutingAssembly());
			// runner.AutoStart = true;

			try
			{
				runner.Writer = new NUnitOutputTextWriter(
					runner,
					new TcpTextWriter("hostname", 16384),
					new NUnitLite.Runner.NUnit2XmlOutputWriter(DateTime.Now));
				
			}
			catch (Exception)
			{
				Console.WriteLine("Cannot set NUNit Runner Writer");
			}
			runner.TerminateAfterExecution = true;

			window.RootViewController = new UINavigationController(runner.GetViewController());
			window.MakeKeyAndVisible();
			return true;
		}
コード例 #2
0
ファイル: AppDelegate.cs プロジェクト: RecursosOnline/c-sharp
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			runner = new TouchRunner (window);

			// tests can be inside the main assembly
			runner.Add (Assembly.GetExecutingAssembly ());
			// otherwise you need to ensure that the test assemblies will 
			// become part of the app bundle
            runner.Add (typeof (PubnubMessaging.Tests.UnitTestAppDelegate).Assembly);
			// you can use the default or set your own custom writer (e.g. save to web site and tweet it ;-)

            //TODO:change before going live
            //string ip = System.Net.IPAddress.Any.ToString();
            runner.Writer = new TcpTextWriter ("10.96.97.4", 16384);

			// start running the test suites as soon as the application is loaded
            runner.AutoStart = true;
			// crash the application (to ensure it's ended) and return to springboard
            //runner.TerminateAfterExecution = true;
			// you can get NUnit[2-3]-style XML reports to the console or server like this
			// replace `null` (default to Console.Out) to a TcpTextWriter to send data to a socket server
			// replace `NUnit2XmlOutputWriter` with `NUnit3XmlOutputWriter` for NUnit3 format
            //runner.Writer = new NUnitOutputTextWriter (runner, null, new NUnitLite.Runner.NUnit2XmlOutputWriter ());
			// the same AutoStart and TerminateAfterExecution can be used for build automation

			window.RootViewController = new UINavigationController (runner.GetViewController ());
			window.MakeKeyAndVisible ();
			return true;
		}
コード例 #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);

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

            UINavigationController navController = new UINavigationController (runner.GetViewController ());

            navController.NavigationBar.BarTintColor = UIColor.FromRGB(0/255.0f,145/255.0f,211/255.0f);
            navController.NavigationBar.TintColor = UIColor.White;
            navController.NavigationBar.TitleTextAttributes = new UIStringAttributes()
            {
                ForegroundColor = UIColor.White,
            };

            window.RootViewController = navController;

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

            return true;
        }
コード例 #4
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)
    {
      app.IdleTimerDisabled = true;

      // create a new window instance based on the screen size
      this.window = new UIWindow(UIScreen.MainScreen.Bounds);
      this.runner = new TouchRunner(this.window);

#if !DEBUG
      this.ConfigureRunnerForCI();
#endif

      app.IdleTimerDisabled = true;

      // register every tests included in the main application/assembly
      var thisAssembly = System.Reflection.Assembly.GetExecutingAssembly();
      this.runner.Add(thisAssembly);


      var viewControllerForTestRunner = this.runner.GetViewController();
      this.window.RootViewController = new UINavigationController(viewControllerForTestRunner);

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

      return true;
    }
コード例 #5
0
 public TestCaseElement(TestCase testCase, TouchRunner runner)
     : base(testCase, runner)
 {
     Caption      = testCase.Name;
     Value        = "NotExecuted";
     this.Tapped += delegate {
         if (!Runner.OpenWriter(Test.FullName))
         {
             return;
         }
         Run();
         Runner.CloseWriter();
         // display more details on (any) failure (but not when ignored)
         if ((TestCase.RunState == RunState.Runnable) && !Result.IsSuccess)
         {
             var root = new RootElement("Results")
             {
                 new Section()
                 {
                     new TestResultElement(Result)
                 }
             };
             var dvc = new DialogViewController(root, true)
             {
                 Autorotate = true
             };
             runner.NavigationController.PushViewController(dvc, true);
         }
     };
 }
コード例 #6
0
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			runner = new TouchRunner (window);

			// tests can be inside the main assembly
			runner.Add (Assembly.GetExecutingAssembly ());
#if false
			// you can use the default or set your own custom writer (e.g. save to web site and tweet it ;-)
			runner.Writer = new TcpTextWriter ("10.0.1.2", 16384);
			// start running the test suites as soon as the application is loaded
			runner.AutoStart = true;
			// crash the application (to ensure it's ended) and return to springboard
			runner.TerminateAfterExecution = true;
#endif
#if false
			// you can get NUnit[2-3]-style XML reports to the console or server like this
			// replace `null` (default to Console.Out) to a TcpTextWriter to send data to a socket server
			// replace `NUnit2XmlOutputWriter` with `NUnit3XmlOutputWriter` for NUnit3 format
			runner.Writer = new NUnitOutputTextWriter (runner, null, new NUnitLite.Runner.NUnit2XmlOutputWriter ());
			// the same AutoStart and TerminateAfterExecution can be used for build automation
#endif
			window.RootViewController = new UINavigationController (runner.GetViewController ());
			window.MakeKeyAndVisible ();
			return true;
		}
コード例 #7
0
ファイル: TestCaseElement.cs プロジェクト: kentcb/Touch.Unit
		public TestCaseElement (TestMethod testCase, TouchRunner runner)
			: base (testCase, runner)
		{
			Caption = testCase.Name;
			Value = "NotExecuted";
            this.Tapped += async delegate {
				if (!Runner.OpenWriter (Test.FullName))
					return;

				var suite = (testCase.Parent as TestSuite);
				var context = TestExecutionContext.CurrentContext;
				context.TestObject = Reflect.Construct (testCase.Method.ReflectedType, null);

                await suite.GetOneTimeSetUpCommand ().Execute (context);
                await Run ();
                await suite.GetOneTimeTearDownCommand ().Execute (context);

				Runner.CloseWriter ();
				// display more details on (any) failure (but not when ignored)
				if ((TestCase.RunState == RunState.Runnable) && !Result.IsSuccess ()) {
					var root = new RootElement ("Results") {
						new Section () {
							new TestResultElement (Result)
						}
					};
					var dvc = new DialogViewController (root, true) { Autorotate = true };
					runner.NavigationController.PushViewController (dvc, true);
				} else if (GetContainerTableView () != null) {
					var root = GetImmediateRootElement ();
					root.Reload (this, UITableViewRowAnimation.Fade);
				}
			};
		}
コード例 #8
0
ファイル: NUnitOutputTextWriter.cs プロジェクト: cg123/xenko
		public NUnitOutputTextWriter (TouchRunner runner, TextWriter baseWriter, OutputWriter xmlWriter)
		{
			Runner = runner;
			BaseWriter = baseWriter ?? Console.Out;
			XmlOutputWriter = xmlWriter;
			// do not send real-time test results on the writer sif XML reports are enabled
			real_time_reporting = (xmlWriter == null);
		}
コード例 #9
0
 public override bool FinishedLaunching(UIApplication app, NSDictionary options)
 {
     window = new UIWindow (UIScreen.MainScreen.Bounds);
     runner = new TouchRunner (window);
     runner.Add (Assembly.GetExecutingAssembly ());
     window.RootViewController = new UINavigationController (runner.GetViewController ());
     window.MakeKeyAndVisible ();
     return true;
 }
コード例 #10
0
 public TestCaseElement(TestCase testCase, TouchRunner runner)
     : base(testCase, runner)
 {
     Caption      = testCase.Name;
     Value        = "NotExecuted";
     this.Tapped += delegate {
         Run();
     };
 }
コード例 #11
0
		public TestCaseElement (TestCase testCase, TouchRunner runner)
			: base (testCase, runner)
		{
			Caption = testCase.Name;
			Value = "NotExecuted";
			this.Tapped += delegate {
				 Run ();
			};
		}
コード例 #12
0
		public TestElement (ITest test, TouchRunner runner)
			: base ("?", "?", UITableViewCellStyle.Subtitle)
		{
			if (test == null)
				throw new ArgumentNullException ("test");
			if (runner == null)
				throw new ArgumentNullException ("runner");
		
			Test = test;
			Runner = runner;
		}
コード例 #13
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);

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

            var path = FileLoadTests.GetDicosPath ();

            var dicos = Path.Combine (
                NSBundle.MainBundle.BundlePath,
                "dicos.json.txt");

            using (var reader = new StreamReader(dicos))
            using (var writer = new StreamWriter(path))
            {
                writer.Write(reader.ReadToEnd());
            }

            path = FileLoadTests.GetTinyPath ();

            var tiny = Path.Combine (
                NSBundle.MainBundle.BundlePath,
                "tiny.json.txt");

            using (var reader = new StreamReader(tiny))
            using (var writer = new StreamWriter(path))
            {
                writer.Write(reader.ReadToEnd());
            }

            path = FileLoadTests.GetHighlyNestedPath ();

            var nested = Path.Combine (
                NSBundle.MainBundle.BundlePath,
                "_oj-highly-nested.json.txt");

            using (var reader = new StreamReader(nested))
            using (var writer = new StreamWriter(path))
            {
                writer.Write(reader.ReadToEnd());
            }

            window.RootViewController = new UINavigationController (runner.GetViewController ());
            
            // make the window visible
            window.MakeKeyAndVisible ();
            
            return true;
        }
コード例 #14
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);
            runner = new TouchRunner(window);

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

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

            return true;
        }
コード例 #15
0
ファイル: AppDelegate.cs プロジェクト: rolfbjarne/Mono.Tests
		//
		// 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)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);
		
			runner = new TouchRunner (window);
			runner.Add (AsyncTestLoader.Load (GetType ().Assembly));
			
			UIApplication.CheckForIllegalCrossThreadCalls = false;
			
			window.RootViewController = new UINavigationController (runner.GetViewController ());
			window.MakeKeyAndVisible ();
			
			return true;
		}
コード例 #16
0
        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.Add (System.Reflection.Assembly.GetExecutingAssembly ());

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

            window.MakeKeyAndVisible ();

            return true;
        }
コード例 #17
0
        public TestElement(ITest test, TouchRunner runner)
            : base("?", "?", UITableViewCellStyle.Subtitle)
        {
            if (test == null)
            {
                throw new ArgumentNullException("test");
            }
            if (runner == null)
            {
                throw new ArgumentNullException("runner");
            }

            Test   = test;
            Runner = runner;
        }
コード例 #18
0
ファイル: AppDelegate.cs プロジェクト: jorik041/Touch.Unit
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			runner = new TouchRunner (window);

			// tests can be inside the main assembly
			runner.Add (Assembly.GetExecutingAssembly ());
			// otherwise you need to ensure that the test assemblies will 
			// become part of the app bundle
			runner.Add (typeof (MonoTouchFixtures.RegressionTest).Assembly);

			window.RootViewController = new UINavigationController (runner.GetViewController ());
			window.MakeKeyAndVisible ();
			return true;
		}
コード例 #19
0
ファイル: AppDelegate.cs プロジェクト: NulledLabs/mvvmlight
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            Window = new UIWindow(UIScreen.MainScreen.Bounds);
            _runner = new TouchRunner(Window);

            // register every tests included in the main application/assembly
            _runner.Add(Assembly.GetExecutingAssembly());

            Window.RootViewController = new UINavigationController(_runner.GetViewController());

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

            return true;
        }
コード例 #20
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);

			// register every tests included in the main application/assembly
			runner.Add (typeof (ReactiveTests.Tests.ObserverTest).Assembly);

			window.RootViewController = new UINavigationController (runner.GetViewController ());
			
			// make the window visible
			window.MakeKeyAndVisible ();
			
			return true;
		}
コード例 #21
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);

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

            _window.RootViewController = new UINavigationController(_runner.GetViewController());

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

            return true;
        }
コード例 #22
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // create a new window instance based on the screen size
            Window = new UIWindow (UIScreen.MainScreen.Bounds);
            Runner = new TouchRunner (Window);

            // tests can be inside the main assembly
            Runner.Add (Assembly.GetExecutingAssembly ());

            Window.RootViewController = new UINavigationController (Runner.GetViewController ());

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

            return true;
        }
コード例 #23
0
		public TestSuiteElement (TestSuite test, TouchRunner runner)
			: base (test, runner)
		{
			Caption = Suite.Name;
			int count = Suite.TestCaseCount;
			if (count > 0) {
				Accessory = UITableViewCellAccessory.DisclosureIndicator;
				DetailColor = DarkGreen;
				Value = String.Format ("{0} test case{1}, {2}", count, count == 1 ? String.Empty : "s", Suite.RunState);
				Tapped += delegate {
					runner.Show (Suite);
				};
			} else {
				DetailColor = Orange;
				Value = "No test was found inside this suite";
			}
		}
コード例 #24
0
		public TestSuiteElement (TestSuite test, TouchRunner runner)
			: base (test, runner)
		{
			Caption = Suite.Name;
			int count = Suite.TestCaseCount;
			if (count > 0) {
				Accessory = UITableViewCellAccessory.DisclosureIndicator;
				DetailColor = DarkGreen;
				Value = String.Format ("{0} test case{1}, {2}", count, count == 1 ? String.Empty : "s", Suite.RunState);
				Tapped += delegate {
					runner.Show (Suite);
				};
			} else {
				DetailColor = UIColor.Orange;
				Value = "No test found inside the assembly";
			}
		}
コード例 #25
0
ファイル: AppDelegate.cs プロジェクト: yqsqq/Bingo
        //
        // 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.AutoStart=true;

            runner.Writer=new StreamWriter("/Users/twer/Desktop/out.txt");

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

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

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

            return true;
        }
コード例 #26
0
        public TestCaseElement(TestMethod testCase, TouchRunner runner)
            : base(testCase, runner)
        {
            Caption      = testCase.Name;
            Value        = "NotExecuted";
            this.Tapped += delegate {
                if (!Runner.OpenWriter(Test.FullName))
                {
                    return;
                }

                var suite   = (testCase.Parent as TestSuite);
                var context = TestExecutionContext.CurrentContext;
                context.TestObject = Reflect.Construct(testCase.Method.ReflectedType, null);

                suite.GetOneTimeSetUpCommand().Execute(context);
                Run();
                suite.GetOneTimeTearDownCommand().Execute(context);

                Runner.CloseWriter();
                // display more details on (any) failure (but not when ignored)
                if ((TestCase.RunState == RunState.Runnable) && !Result.IsSuccess())
                {
                    var root = new RootElement("Results")
                    {
                        new Section()
                        {
                            new TestResultElement(Result)
                        }
                    };
                    var dvc = new DialogViewController(root, true)
                    {
                        Autorotate = true
                    };
                    runner.NavigationController.PushViewController(dvc, true);
                }
                else if (GetContainerTableView() != null)
                {
                    var root = GetImmediateRootElement();
                    root.Reload(this, UITableViewRowAnimation.Fade);
                }
            };
        }
コード例 #27
0
        public TestElement(ITest test, TouchRunner runner)
            : base("?", "?", UITableViewCellStyle.Subtitle)
        {
            if (test == null)
            {
                throw new ArgumentNullException("test");
            }
            if (runner == null)
            {
                throw new ArgumentNullException("runner");
            }

            if (UIDevice.CurrentDevice.CheckSystemVersion(13, 0))
            {
                TextColor = UIColor.LabelColor;
            }
            Test   = test;
            Runner = runner;
        }
コード例 #28
0
ファイル: AppDelegate.cs プロジェクト: mganss/MicroJson
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);
            runner = new TouchRunner(window);

            // tests can be inside the main assembly
            runner.Add(Assembly.GetExecutingAssembly());
            #if false
            // you can use the default or set your own custom writer (e.g. save to web site and tweet it ;-)
            runner.Writer = new TcpTextWriter ("10.0.1.2", 16384);
            // start running the test suites as soon as the application is loaded
            runner.AutoStart = true;
            // crash the application (to ensure it's ended) and return to springboard
            runner.TerminateAfterExecution = true;
            #endif
            window.RootViewController = new UINavigationController(runner.GetViewController());
            window.MakeKeyAndVisible();
            return true;
        }
コード例 #29
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);

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

              Gigya.InitWithAPIKey("3_Sh5iokMA9q0k5i8s5P4K3O8eYAax9Q0QPLPsXO0MRa4YXiETXRTTypmr8iYAlfRz", UIApplication.SharedApplication, new NSDictionary());

              NavigationController = new UINavigationController(runner.GetViewController());

              window.RootViewController = NavigationController;

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

              return Facebook.CoreKit.ApplicationDelegate.SharedInstance.FinishedLaunching(app, options);
        }
コード例 #30
0
		public TestCaseElement (TestMethod testCase, TouchRunner runner)
			: base (testCase, runner)
		{
			Caption = testCase.Name;
			Value = "NotExecuted";
			this.Tapped += delegate {
				if (!Runner.OpenWriter (Test.FullName))
					return;
				Run ();
				Runner.CloseWriter ();
				// display more details on (any) failure (but not when ignored)
				if ((TestCase.RunState == RunState.Runnable) && !Result.IsSuccess ()) {
					var root = new RootElement ("Results") {
						new Section () {
							new TestResultElement (Result)
						}
					};
					var dvc = new DialogViewController (root, true) { Autorotate = true };
					runner.NavigationController.PushViewController (dvc, true);
				}
			};
		}