示例#1
0
        public static void StartTestRunnerImmediate(this Application application)
        {
            UnitTestSettings settings = UnitTestSystem.CreateDefaultSettings();

            settings.StartRunImmediately = true;
            application.RootVisual       = UnitTestSystem.CreateTestPage(settings);
        }
示例#2
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            var settings = UnitTestSystem.CreateDefaultSettings();

            //settings. = true;
            RootVisual = UnitTestSystem.CreateTestPage(settings);
        }
示例#3
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            UnitTestProviders.Providers.Clear();
            UnitTestSystem.RegisterUnitTestProvider(new RavenCustomProvider());

            RootVisual = UnitTestSystem.CreateTestPage();
        }
示例#4
0
 // Constructor
 public MainPage()
 {
     InitializeComponent();
     this.Content = UnitTestSystem.CreateTestPage();
     // Sample code to localize the ApplicationBar
     //BuildLocalizedApplicationBar();
 }
示例#5
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            var settings = UnitTestSystem.CreateDefaultSettings();

            settings.StartRunImmediately = true;
            this.RootVisual = UnitTestSystem.CreateTestPage(settings);
        }
示例#6
0
 // Constructor
 public MainPage()
 {
     InitializeComponent();
     this.Content = UnitTestSystem.CreateTestPage();
     // Código de ejemplo para traducir ApplicationBar
     //BuildLocalizedApplicationBar();
 }
示例#7
0
        public UIElement StartRun()
        {
            Server.Debug("MSTestRunnerHost.StartRun()");
            SetupUnitTestProvider(_clientTestRunConfiguration.UnitTestProviderType);
            Server.Debug("Completed - SetupUnitTestProvider(" + _clientTestRunConfiguration.UnitTestProviderType + ")");

            var settings = ConfigureSettings();

            Server.Debug("Completed - ConfigureSettings()");

            var ui = UnitTestSystem.CreateTestPage(settings);

#if !MSTest2009July && !MSTest2009October && !MSTest2009November
            // This little hack appears to fix a duplicate reporting issue of the first test as reported here
            // http://statlight.codeplex.com/workitem/11906
            //
            // I found that this hack doesn't work for all cases, specifically older versions of the test frmework (reason for the #if...)
            // And it also doesn't work for a U.I. test.
            // http://itcrank.blogspot.com.au/2012/02/dodgy-silverlight-unittest-system.html

            //if (!_clientTestRunConfiguration.WindowGeometry.ShouldShowWindow)
            //    settings.TestAssemblies.Clear();
#endif
            Server.Debug("Completed - UnitTestSystem.CreateTestPage(...)");
            return(ui);
        }
示例#8
0
        private void ApplicationStartup(object sender, StartupEventArgs e)
        {
            var unitTestProvider = new UnitTestProvider();

            UnitTestSystem.RegisterUnitTestProvider(unitTestProvider);
            RootVisual = UnitTestSystem.CreateTestPage();
        }
示例#9
0
        public MainPage()
        {
            InitializeComponent();

            SupportedOrientations = SupportedPageOrientation.Portrait | SupportedPageOrientation.Landscape;

            var settings = UnitTestSystem.CreateDefaultSettings();

            settings.TestAssemblies.Add(typeof(Tags).Assembly);

            settings.SampleTags.Clear();
            settings.SampleTags.Add(Tags.Model);
            settings.SampleTags.Add(Tags.ViewModel);
            settings.SampleTags.Add(Tags.WebService);
            settings.ShowTagExpressionEditor = true;

            Content = UnitTestSystem.CreateTestPage(settings);

            var imtp = Content as IMobileTestPage;

            if (imtp != null)
            {
                BackKeyPress += (x, xe) => xe.Cancel = imtp.NavigateBack();
            }
        }
示例#10
0
        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            var testPage = UnitTestSystem.CreateTestPage() as IMobileTestPage;

            BackKeyPress += (x, xe) => xe.Cancel = testPage.NavigateBack();
            (Application.Current.RootVisual as PhoneApplicationFrame).Content = testPage;
        }
示例#11
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            var harness  = new UnitTestHarness();
            var settings = new UnitTestSettings();

            settings.TestHarness = harness;
            harness.Settings     = settings;
            harness.Initialize();

            harness.TestRunStarting += (senderx, ex) =>
            {
                var provider = new TestProvider();
                var filter   = new TagTestRunFilter(settings, harness, settings.TagExpression);

                var features = FeatureFactory.GetFeatures(typeof(App).Assembly);
                foreach (var feature in features)
                {
                    provider.RegisterFeature(feature);
                    var ass = provider.GetUnitTestAssembly(harness, feature.Assembly);
                    harness.EnqueueTestAssembly(ass, filter);
                }
            };

            this.RootVisual = UnitTestSystem.CreateTestPage(settings);
        }
示例#12
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            Content       = UnitTestSystem.CreateTestPage();
            BackKeyPress += (x, xe) => xe.Cancel = (Content as IMobileTestPage).NavigateBack();
        }
        /// <summary>
        /// Initializes the page and hooks up the test framework.
        /// </summary>
        public MainPage()
        {
            InitializeComponent();

            // Creates a test page that will replace this page contents.
            this.Content = UnitTestSystem.CreateTestPage();
        }
示例#14
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            this.Loaded += delegate(object sender, RoutedEventArgs e)
            {
                if (runUnitTests)
                {
                    UnitTestSettings settings = UnitTestSystem.CreateDefaultSettings();

                    if (null != Deployment.Current)
                    {
                        var parts            = Deployment.Current.Parts;
                        var assembliesToLoad = new List <string> {
                            "UnitTest_S3", "UnitTest_SimpleDB", "UnitTest_SQS"
                        };                                                                                              //ADD THE NAME OF THE ASSEMBLY TO TEST HERE AND LOAD IT.
                        int count = 0;

                        //Clear all the test-assemblies.
                        settings.TestAssemblies.Clear();

                        //Algorithm.
                        //0.NOTE: ADD THE NAME OF THE ASSEMBLIES TO TEST MANUALLY.
                        //1.Assembly.Load() cannot load assemblies as it would do in a normal .NET applications.
                        //Hence, the only way to do is to make a explicit reference to them from this main executing assembly(.exe, a Windows Phone Application).
                        //Reason, to enable loading assemblies dynamically, they need to be signed by Windows Market.

                        //2. Specify the assemblies that need to be tested explicitly to the testing runtime=> UnitTestSettings.TestAssemblies() method.
                        foreach (var part in parts)
                        {
                            var assemblyName = part.Source.Replace(".dll", string.Empty);
                            if (!assembliesToLoad.Contains(assemblyName))
                            {
                                continue;
                            }

                            var assembly = Assembly.Load(assemblyName);
                            count++;

                            settings.TestAssemblies.Add(assembly);
                            if (count >= assembliesToLoad.Count)
                            {
                                break;
                            }
                        }

                        UserControl content = UnitTestSystem.CreateTestPage(settings) as UserControl;
                        (Application.Current.RootVisual as PhoneApplicationFrame).Content = content;
                        (Application.Current.RootVisual as PhoneApplicationFrame).Padding = new Thickness(-50);

                        IMobileTestPage imtp = (Application.Current.RootVisual as PhoneApplicationFrame).Content as IMobileTestPage;

                        if (imtp != null)
                        {
                            BackKeyPress += (x, xe) => xe.Cancel = imtp.NavigateBack();
                        }
                    }
                }
            };
        }
示例#15
0
        void MainPageLoaded(object sender, RoutedEventArgs e)
        {
            SystemTray.IsVisible = false;
            var testPage = UnitTestSystem.CreateTestPage() as IMobileTestPage;

            BackKeyPress += (o, a) => a.Cancel = testPage.NavigateBack();
            (Application.Current.RootVisual as PhoneApplicationFrame).Content = testPage;
        }
示例#16
0
        static UIElement CreateRootVisual(UnitTestSettings settings)
        {
            TestPage testPage = (TestPage)UnitTestSystem.CreateTestPage(settings);
            ComboBox comboBox = null;
            TestGrid grid     = new TestGrid(comboBox, testPage);

            return(grid);
        }
示例#17
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     //*******************
     // Register the XUnitTestProvider with the Microsoft.Silverlight.Testing framework.
     // UnitTestSystem.RegisterUnitTestProvider(new Microsoft.Silverlight.Testing.UnitTesting.Metadata.XunitLight.XUnitTestProvider());
     //*******************
     this.RootVisual = UnitTestSystem.CreateTestPage();
 }
示例#18
0
        public static void StartTestRunner(this PhoneApplicationPage mainPage)
        {
            SystemTray.IsVisible = false;
            var testPage = UnitTestSystem.CreateTestPage() as IMobileTestPage;

            mainPage.BackKeyPress += (x, xe) => xe.Cancel = testPage.NavigateBack();
            (Application.Current.RootVisual as PhoneApplicationFrame).Content = testPage;
        }
示例#19
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            NUnit.Framework.Assert.IsTrue(true); // force NUnitFarmework.dll to load
            UnitTestSystem.RegisterUnitTestProvider(new NUnitProvider());
            UnitTestSettings settings = UnitTestSystem.CreateDefaultSettings();

            settings.TestAssemblies.Add(typeof(global::FSharp.Core.Unittests.LibraryTestFx).Assembly);
            RootVisual = UnitTestSystem.CreateTestPage(settings);
        }
示例#20
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            UnitTestSystem.RegisterUnitTestProvider(new UnitTestProvider());
            UnitTestSettings settings = UnitTestSystem.CreateDefaultSettings();

            settings.SortTestClasses = false;
            settings.SortTestMethods = false;
            RootVisual = UnitTestSystem.CreateTestPage(settings);
        }
示例#21
0
        private void OnApplicationStartup(object sender, StartupEventArgs e)
        {
            /*
             * Wire the XunitLight test harness provider into the silverlight testing framework
             */
            UnitTestSystem.RegisterUnitTestProvider(new XUnitTestProvider());

            this.RootVisual = UnitTestSystem.CreateTestPage();
        }
示例#22
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            var settings = UnitTestSystem.CreateDefaultSettings();

            settings.StartRunImmediately     = false;
            settings.ShowTagExpressionEditor = true;

            RootVisual = UnitTestSystem.CreateTestPage(settings);
        }
        private void MainPage_OnLoaded(object sender, RoutedEventArgs e)
        {
            SystemTray.IsVisible = false;

            var testPage = (IMobileTestPage)UnitTestSystem.CreateTestPage();

            BackKeyPress += (x, xe) => xe.Cancel = testPage.NavigateBack();
            ((PhoneApplicationFrame)Application.Current.RootVisual).Content = testPage;
        }
示例#24
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            // Hook up and execute this test project
            // For details: http://www.jeff.wilcox.name/fwlink/?0e0slb2
            UnitTestSettings settings = UnitTestSystem.CreateDefaultSettings();

            settings.TestService = null;
            this.RootVisual      = UnitTestSystem.CreateTestPage(settings);
        }
示例#25
0
        private void OnStartup(object sender, EventArgs e)
        {
            // Initialize and start the test framework
#if MOONLIGHT
            this.RootVisual = Mono.Moonlight.UnitTesting.Testing.CreateTestPage(this);
#else
            this.RootVisual = UnitTestSystem.CreateTestPage();
#endif
        }
示例#26
0
        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            SystemTray.IsVisible = false;
            UnitTestSystem.RegisterUnitTestProvider(new XunitContrib.Runner.Silverlight.Toolkit.UnitTestProvider());

            var testPage = UnitTestSystem.CreateTestPage() as IMobileTestPage;

            BackKeyPress += (x, xe) => xe.Cancel = testPage.NavigateBack();
            (Application.Current.RootVisual as PhoneApplicationFrame).Content = testPage;
        }
示例#27
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            const bool runUnitTests = true;

            if (runUnitTests)
            {
                Content = UnitTestSystem.CreateTestPage();
            }
        }
示例#28
0
        private void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            SystemTray.IsVisible = false;
            var unitTestSettings = UnitTestSystem.CreateDefaultSettings();

            unitTestSettings.TestHarness.TestHarnessCompleted += HandleTestCompleted;
            var testPage = UnitTestSystem.CreateTestPage() as IMobileTestPage;

            BackKeyPress += (x, xe) => xe.Cancel = testPage.NavigateBack();
            (Application.Current.RootVisual as PhoneApplicationFrame).Content = testPage;
        }
        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            var testSettings = UnitTestSystem.CreateDefaultSettings();

            testSettings.TestAssemblies.Add(Assembly.GetExecutingAssembly());

            var testPage = UnitTestSystem.CreateTestPage(testSettings) as IMobileTestPage;

            BackKeyPress += (x, xe) => xe.Cancel = testPage.NavigateBack();
            (Application.Current.RootVisual as PhoneApplicationFrame).Content = testPage;
        }
示例#30
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            LogProvider fileLogProvider = new FileLogProvider();
            var         settings        = UnitTestSystem.CreateDefaultSettings();

            settings.LogProviders.Add(fileLogProvider);

            Content       = UnitTestSystem.CreateTestPage(settings);
            BackKeyPress += (x, xe) => xe.Cancel = (Content as IMobileTestPage).NavigateBack();
        }