public void SetupTestRun()
        {
            var config = new SpecsForMvcConfig();
            //SpecsFor.Mvc can spin up an instance of IIS Express to host your app
            //while the specs are executing.
            config.UseIISExpress()
                //To do that, it needs to know the name of the project to test...
                .With(Project.Named("MusicInstructor.Web"))
                //And optionally, it can apply Web.config transformations if you want
                //it to.
                .ApplyWebConfigTransformForConfig("Integration");

            //In order to leverage the strongly-typed helpers in SpecsFor.Mvc,
            //you need to tell it about your routes.  Here we are just calling
            //the infrastructure class from our MVC app that builds the RouteTable.
            config.BuildRoutesUsing(RouteConfig.RegisterRoutes);
            //SpecsFor.Mvc can use either Internet Explorer or Firefox.  Support
            //for Chrome is planned for a future release.
            config.UseBrowser(BrowserDriver.InternetExplorer);

            //Does your application send E-mails?  Well, SpecsFor.Mvc can intercept
            //those while your specifications are executing, enabling you to write
            //tests against the contents of sent messages.
            config.InterceptEmailMessagesOnPort(13565);

            config.Use<SeedDataConfig>();

            //The host takes our configuration and performs all the magic.  We
            //need to keep a reference to it so we can shut it down after all
            //the specifications have executed.
            _host = new SpecsForIntegrationHost(config);
            _host.Start();
        }
        private void HostStart()
        {
            var config = new SpecsForMvcConfig();
            config.UseIISExpress()
                .With(Project.Named("NHibernate.AspNet.Web"))
                .CleanupPublishedFiles()
                .ApplyWebConfigTransformForConfig("Debug");

            //TODO: The order of registration matters right now, but it shouldn't. 
            //config.RegisterArea<TasksAreaRegistration>();
            config.BuildRoutesUsing(r => RouteConfig.RegisterRoutes(r));

            //NOTE: You can use whatever browser you want.  For build servers, you can check an environment
            //		variable to determine which browser to use, enabling you to re-run the same suite of
            //		tests once for each browser. 
            //config.UseBrowser(BrowserDriver.InternetExplorer);
            //config.UseBrowser(BrowserDriver.Chrome);
            config.UseBrowser(BrowserDriver.Firefox);

            config.InterceptEmailMessagesOnPort(13565);

            config.AuthenticateBeforeEachTestUsing<StandardAuthenticator>();

            _host = new SpecsForIntegrationHost(config);
            _host.Start();
        }
Example #3
0
        public void SetupTestRun()
        {
            var config = new SpecsForMvcConfig();

            config.UseIISExpress()
            .UsePort(44300)
            .UseHttps()
            .With(Project.Named("SpecsFor.Mvc.Demo"))
            .CleanupPublishedFiles()
            .ApplyWebConfigTransformForConfig("Test");

            //TODO: The order of registration matters right now, but it shouldn't.
            config.RegisterArea <TasksAreaRegistration>();
            config.BuildRoutesUsing(r => MvcApplication.RegisterRoutes(r));

            //NOTE: You can use whatever browser you want.  For build servers, you can check an environment
            //		variable to determine which browser to use, enabling you to re-run the same suite of
            //		tests once for each browser.
            //config.UseBrowser(BrowserDriver.InternetExplorer);
            config.UseBrowser(BrowserDriver.Chrome);
            //config.UseBrowser(BrowserDriver.Firefox);

            config.InterceptEmailMessagesOnPort(13565);

            config.AuthenticateBeforeEachTestUsing <StandardAuthenticator>();

            config.SetBrowserWindowSize(width: 1024, height: 768);

            _host = new SpecsForIntegrationHost(config);
            _host.Start();
        }
Example #4
0
        public void SetUp()
        {
            var configuration = new Allors.Adapters.Object.SqlClient.Configuration
            {
                ConnectionString = ConfigurationManager.ConnectionStrings["allors"].ConnectionString,
                ObjectFactory = Config.ObjectFactory,
                CommandTimeout = 0
            };

            Config.Default = new Allors.Adapters.Object.SqlClient.Database(configuration);

            var config = new SpecsForMvcConfig();
            config.UseIISExpress()
                .With(Project.Named("Website"))
                .CleanupPublishedFiles();

            config.BuildRoutesUsing(RouteConfig.RegisterRoutes);

            //config.UseBrowser(BrowserDriver.InternetExplorer);
            //config.UseBrowser(BrowserDriver.Chrome);
            config.UseBrowser(BrowserDriver.Firefox);

            config.InterceptEmailMessagesOnPort(13565);

            this.host = new SpecsForIntegrationHost(config);

            // If you encounter errors then please run the following command at the command prompt
            // (make sure msbuild is in your path, e.g. use the Visual Studio Command Prompt)
            //
            // msbuild [SolutionName].sln /p:DeployOnBuild=true;DeployTarget=Package;_PackageTempDir="C:\github\allors\Base\Tests\bin\x64\Debug\SpecsForMvc.TempIntermediateDir
            using (var stringWriter = new StringWriter())
            {
                TextWriter console = null;
                try
                {
                    console = Console.Out;
                    Console.SetOut(stringWriter);
                    this.host.Start();
                }
                catch (Exception ex)
                {
                    try
                    {
                        if (this.host != null)
                        {
                            this.host.Shutdown();
                        }
                    }
                    finally
                    {
                        if (console != null)
                        {
                            Console.SetOut(console);
                        }

                        throw new Exception("Build failed. Output: " + stringWriter, ex);
                    }
                }
            }
        }
        private void HostStart()
        {
            var config = new SpecsForMvcConfig();

            config.UseIISExpress()
            .With(Project.Named("NHibernate.AspNet.Web"))
            .CleanupPublishedFiles()
            .ApplyWebConfigTransformForConfig("Debug");

            //TODO: The order of registration matters right now, but it shouldn't.
            //config.RegisterArea<TasksAreaRegistration>();
            config.BuildRoutesUsing(r => RouteConfig.RegisterRoutes(r));

            //NOTE: You can use whatever browser you want.  For build servers, you can check an environment
            //		variable to determine which browser to use, enabling you to re-run the same suite of
            //		tests once for each browser.
            //config.UseBrowser(BrowserDriver.InternetExplorer);
            //config.UseBrowser(BrowserDriver.Chrome);
            config.UseBrowser(BrowserDriver.Firefox);

            config.InterceptEmailMessagesOnPort(13565);

            //config.AuthenticateBeforeEachTestUsing<StandardAuthenticator>();

            _host = new SpecsForIntegrationHost(config);
            _host.Start();
        }
Example #6
0
		public void SetupTestRun()
		{
			var config = new SpecsForMvcConfig();
			config.UseIISExpress()
				.UsePort(44300)
				.UseHttps()
				.With(Project.Named("SpecsFor.Mvc.Demo"))
				.CleanupPublishedFiles()
				.ApplyWebConfigTransformForConfig("Test");

			//TODO: The order of registration matters right now, but it shouldn't. 
			config.RegisterArea<TasksAreaRegistration>();
			config.BuildRoutesUsing(r => MvcApplication.RegisterRoutes(r));

			//NOTE: You can use whatever browser you want.  For build servers, you can check an environment
			//		variable to determine which browser to use, enabling you to re-run the same suite of
			//		tests once for each browser. 
			//config.UseBrowser(BrowserDriver.InternetExplorer);
			config.UseBrowser(BrowserDriver.Chrome);
			//config.UseBrowser(BrowserDriver.Firefox);

			config.InterceptEmailMessagesOnPort(13565);

			config.AuthenticateBeforeEachTestUsing<StandardAuthenticator>();

		    config.SetBrowserWindowSize(width: 1024, height: 768);

			_host = new SpecsForIntegrationHost(config);
			_host.Start();
		}
Example #7
0
        public void Startup()
        {
            var config = new SpecsForMvcConfig();

            config.UseIISExpress().With(Project.Named("HeroicSupport.Web")).ApplyWebConfigTransformForConfig("Test");
            config.BuildRoutesUsing(RouteConfig.RegisterRoutes);
            config.UseBrowser(BrowserDriver.Chrome);
            config.AuthenticateBeforeEachTestUsing <RegularUserAuthenticator>();

            config.InterceptEmailMessagesOnPort(12345);

            config.Use <SeedDataConfig>();

            _host = new SpecsForIntegrationHost(config);
            _host.Start();
        }
Example #8
0
        public void Start()
        {
            var config = new SpecsForMvcConfig();
            config.UseIISExpress()
                .With(Project.Named("FailTracker.Web"))
                .ApplyWebConfigTransformForConfig("Test");

            config.BuildRoutesUsing(r => new RouteBootstrapper(r).Execute());

            config.Use<TestSeedData>();

            config.AuthenticateBeforeEachTestUsing<RegularUserAuthenticator>();

            config.InterceptEmailMessagesOnPort(49999);

            _host = new SpecsForIntegrationHost(config);
            _host.Start();
        }
Example #9
0
        public void SetupTestRun()
        {
            var config = new SpecsForMvcConfig();
            config.UseIISExpress()
                .With(Project.Named("SpecsFor.Mvc.Demo"))
                .ApplyWebConfigTransformForConfig("Test");

            config.BuildRoutesUsing(r => MvcApplication.RegisterRoutes(r));
            config.RegisterArea<TasksAreaRegistration>();

            config.UseBrowser(BrowserDriver.InternetExplorer);

            config.InterceptEmailMessagesOnPort(13565);

            config.AuthenticateBeforeEachTestUsing<StandardAuthenticator>();

            _host = new SpecsForIntegrationHost(config);
            _host.Start();
        }
Example #10
0
        public void SetupTestRun()
        {
            var config = new SpecsForMvcConfig();

            config.UseIISExpress()
            .With(Project.Named("SpecsFor.Mvc.Demo"))
            .ApplyWebConfigTransformForConfig("Test");

            config.BuildRoutesUsing(r => MvcApplication.RegisterRoutes(r));
            config.RegisterArea <TasksAreaRegistration>();

            config.UseBrowser(BrowserDriver.InternetExplorer);

            config.InterceptEmailMessagesOnPort(13565);

            config.AuthenticateBeforeEachTestUsing <StandardAuthenticator>();

            _host = new SpecsForIntegrationHost(config);
            _host.Start();
        }
Example #11
0
        public void SetupTestRun()
        {
            var config = new SpecsForMvcConfig();
            config.UseIISExpress()
                .With(Project.Named("Xvolt.Web"));
            //.ApplyWebConfigTransformForConfig("Test");

            config.BuildRoutesUsing(RouteConfig.RegisterRoutes);

            //NOTE: You can use whatever browser you want.  For build servers, you can check an environment
            //		variable to determine which browser to use, enabling you to re-run the same suite of
            //		tests once for each browser.
            //config.UseBrowser(BrowserDriver.InternetExplorer);
            config.UseBrowser(BrowserDriver.Chrome);
            //config.UseBrowser(BrowserDriver.Firefox);

            config.InterceptEmailMessagesOnPort(13565);

            _host = new SpecsForIntegrationHost(config);
            _host.Start();
        }
Example #12
0
        public void SetupTestRun()
        {
            var config = new SpecsForMvcConfig();

            //SpecsFor.Mvc can spin up an instance of IIS Express to host your app
            //while the specs are executing.
            config.UseIISExpress()
            //To do that, it needs to know the name of the project to test...
            .With(Project.Named("Mvc5TestBed.MyMvcWebApp"));
            //And optionally, it can apply Web.config transformations if you want it to
            //.ApplyWebConfigTransformForConfig("Test");

            //In order to leverage the strongly-typed helpers in SpecsFor.Mvc,
            //you need to tell it about your routes.  Here we are just calling
            //the infrastructure class from our MVC app that builds the RouteTable.
            config.BuildRoutesUsing(r => RouteConfig.RegisterRoutes(r));
            //SpecsFor.Mvc can use either Internet Explorer or Firefox.  Support
            //for Chrome is planned for a future release.
            config.UseBrowser(BrowserDriver.Chrome);
            //config.UseBrowser(BrowserDriver.Firefox);


            //// If you want to be authenticated for each request,
            // // implement IHandleAuthentication
            //config.AuthenticateBeforeEachTestUsing<SampleAuthenticator>();

            //Does your application send E-mails?  Well, SpecsFor.Mvc can intercept
            //those while your specifications are executing, enabling you to write
            //tests against the contents of sent messages.
            config.InterceptEmailMessagesOnPort(50957);

            //The host takes our configuration and performs all the magic.  We
            //need to keep a reference to it so we can shut it down after all
            //the specifications have executed.
            _host = new SpecsForIntegrationHost(config);
            _host.Start();
        }