Esempio n. 1
0
        public void Background()
        {
            "Start Server".x(() =>
            {
                this.backend = new FakeBackEndFacade();

                this.server = new SeleniumServerFactory <Startup>(
                    s => s
                    .AddSingleton <IGuidGenerator>(p => new FakeGuidGenerator())
                    .AddSingleton <IBackEndFacade>(p => this.backend));
                this.server.StartupServerInstance();

                this.browser = new ChromeDriver(
                    @"D:\selenium");

                this.wait = new WebDriverWait(
                    this.browser,
                    TimeSpan.FromSeconds(5));
                this.wait.PollingInterval = TimeSpan.FromMilliseconds(100);
            }).Teardown(() =>
            {
                this.browser.Dispose();
                this.server.Dispose();
            });
        }
Esempio n. 2
0
        public void Background()
        {
            "es existiert ein Server".x(() =>
            {
                this.guidGenerator    = new FakeGuidGenerator();
                this.backend          = new FakeBackEndFacade();
                var serverHostBuilder = new WebHostBuilder();
                serverHostBuilder
                .ConfigureServices(s =>
                                   s
                                   .AddSingleton <IGuidGenerator>(p => this.guidGenerator)
                                   .AddSingleton <IBackEndFacade>(p => this.backend))
                .UseStartup <Startup>();

                this.server = new TestServer(serverHostBuilder);
                this.client = this.server.CreateClient();
            });
        }