예제 #1
0
        private async Task RunUnitTestCase(UnitTestCase c, bool verbose)
        {
            UnitTestCaseState newState = UnitTestCaseState.NotRun;
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                RunningTestCase = c;
            });

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                c.Traces.Clear();
            });

            c.Dispatcher = Dispatcher;
            if (BelleSipTester.Instance.run(c.Suite.Name, c.Name, verbose))
            {
                newState = UnitTestCaseState.Failure;
            }
            else
            {
                newState = UnitTestCaseState.Success;
            }
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                c.State = newState;
                ProgressIndicator.Value += 1;
                if (ProgressIndicator.Value == ProgressIndicator.Maximum)
                {
                    UnprepareRun();
                }
            });
        }
예제 #2
0
        private void RunSingle_Click(object sender, RoutedEventArgs e)
        {
            PrepareRun(1);

            var tup = new Tuple <UnitTestCase, bool?>(DisplayedTestCase, Verbose.IsChecked);
            var t   = Task.Factory.StartNew(async(object parameters) =>
            {
                var p          = parameters as Tuple <UnitTestCase, bool?>;
                UnitTestCase c = p.Item1;
                bool verbose   = p.Item2 != null ? (bool)p.Item2 : false;
                await RunUnitTestCase(c, verbose);
            }, tup);
        }
예제 #3
0
        private void Test_Tapped(object sender, TappedRoutedEventArgs e)
        {
            UnitTestCase test = (sender as ListView).SelectedItem as UnitTestCase;

            if (test == null)
            {
                return;
            }
            //test.Name = test.Name.Replace("+", "%2B").Replace(" ", "%20");
            if (!(Application.Current as App).suiteRunning())
            {
                Dictionary <string, string> parameters = new Dictionary <string, string>();
                parameters.Add("suite", SuiteName.Text);
                parameters.Add("test", test.Name);
                parameters.Add("verbose", Verbose.IsChecked.ToString());
                Frame.Navigate(typeof(ResultPage), parameters);
            }
        }