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();
        }
Esempio n. 2
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();
        }
Esempio n. 3
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();
        }