示例#1
0
        static public void AssemblyInit(TestContext tc)
        {
            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("Bonobo.Git.Server"))
            .UsePort(20000);
            //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 => Bonobo.Git.Server.App_Start.RouteConfig.RegisterRoutes(r));
            //SpecsFor.Mvc can use either Internet Explorer or Firefox.  Support
            //for Chrome is planned for a future release.
            config.UseBrowser(BrowserDriver.InternetExplorer);

            config.AuthenticateBeforeEachTestUsing <AuthHandler>();

            //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);

            //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();
        }
示例#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();
        }
        public static void AssemblyInit(TestContext tc)
        {
            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("Bonobo.Git.Server"))
                .UsePort(20000);
                //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 => Bonobo.Git.Server.App_Start.RouteConfig.RegisterRoutes(r));
            //SpecsFor.Mvc can use either Internet Explorer or Firefox.  Support
            //for Chrome is planned for a future release.
            config.UseBrowser(BrowserDriver.InternetExplorer);

            config.AuthenticateBeforeEachTestUsing<AuthHandler>();

            //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);

            //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();
        }
示例#5
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();
		}
示例#6
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();
        }
示例#7
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();
        }
示例#8
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();
        }
示例#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();
        }