Exemplo n.º 1
0
        public static void StartTestRunnerImmediate(this Application application)
        {
            UnitTestSettings settings = UnitTestSystem.CreateDefaultSettings();

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

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

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

            settings.StartRunImmediately = true;
            this.RootVisual = UnitTestSystem.CreateTestPage(settings);
        }
Exemplo n.º 6
0
 // Constructor
 public MainPage()
 {
     InitializeComponent();
     this.Content = UnitTestSystem.CreateTestPage();
     // Código de ejemplo para traducir ApplicationBar
     //BuildLocalizedApplicationBar();
 }
Exemplo n.º 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);
        }
Exemplo n.º 8
0
        private void ApplicationStartup(object sender, StartupEventArgs e)
        {
            var unitTestProvider = new UnitTestProvider();

            UnitTestSystem.RegisterUnitTestProvider(unitTestProvider);
            RootVisual = UnitTestSystem.CreateTestPage();
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 12
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            Content       = UnitTestSystem.CreateTestPage();
            BackKeyPress += (x, xe) => xe.Cancel = (Content as IMobileTestPage).NavigateBack();
        }
Exemplo n.º 13
0
        /// <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();
        }
Exemplo n.º 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();
                        }
                    }
                }
            };
        }
Exemplo n.º 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;
        }
Exemplo n.º 16
0
        static UIElement CreateRootVisual(UnitTestSettings settings)
        {
            TestPage testPage = (TestPage)UnitTestSystem.CreateTestPage(settings);
            ComboBox comboBox = null;
            TestGrid grid     = new TestGrid(comboBox, testPage);

            return(grid);
        }
Exemplo n.º 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();
 }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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();
        }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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
        }
Exemplo n.º 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;
        }
Exemplo n.º 27
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            const bool runUnitTests = true;

            if (runUnitTests)
            {
                Content = UnitTestSystem.CreateTestPage();
            }
        }
Exemplo n.º 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;
        }
Exemplo n.º 29
0
        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;
        }
Exemplo n.º 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();
        }