protected override void Before_all_tests()
        {
            base.Before_all_tests();

            var webServerLocation = new WebServerLocation(TestLogger, 38881);
            var consoleLogger = new ConsoleLogger(LogChatterLevels.Full);
            _hostXap = new byte[] { 5, 4, 2, 1, 4 };
            var clientConfig = new ClientTestRunConfiguration(UnitTestProviderType.MSTest, new List<string>(), "", 1, WebBrowserType.SelfHosted, string.Empty, new WindowGeometry(), new List<string>());
            _serializedConfiguration = clientConfig.Serialize();

            var dummyServerTestRunConfiguration = GetDummyServerTestRunConfiguration();
            var statLightConfiguration = new StatLightConfiguration(clientConfig, dummyServerTestRunConfiguration);
            var currentStatLightConfiguration = new CurrentStatLightConfiguration(statLightConfiguration);

            _responseFactory = new ResponseFactory(currentStatLightConfiguration);
            _mockPostHandler = new Mock<IPostHandler>();
            _inMemoryWebServer = new InMemoryWebServer(consoleLogger, webServerLocation, _responseFactory, _mockPostHandler.Object, base.TestEventPublisher);
            _webClient = new WebClient();

            _baseUrl = webServerLocation.BaseUrl.ToString();

            _inMemoryWebServer.Start();
        }
Example #2
0
 public ResponseFactory(Func<byte[]> hostXapFactory, ClientTestRunConfiguration clientTestRunConfiguration)
 {
     _hostXapFactory = hostXapFactory;
     _serializedConfiguration = clientTestRunConfiguration.Serialize();
 }
        protected override void Before_all_tests()
        {
            base.Before_all_tests();

            var webServerLocation = new WebServerLocation(TestLogger, 38881);
            var consoleLogger = new ConsoleLogger(LogChatterLevels.Full);
            _hostXap = new byte[] { 5, 4, 2, 1, 4 };
            var clientConfig = new ClientTestRunConfiguration(UnitTestProviderType.MSTest, new List<string>(), "", 1, WebBrowserType.SelfHosted, false, string.Empty, null);
            _serializedConfiguration = clientConfig.Serialize();
            _responseFactory = new ResponseFactory(() => _hostXap, clientConfig);

            _mockPostHandler = new Mock<IPostHandler>();
            _inMemoryWebServer = new Core.WebServer.InMemoryWebServer(consoleLogger, webServerLocation, _responseFactory, _mockPostHandler.Object);
            _webClient = new WebClient();

            _baseUrl = webServerLocation.BaseUrl.ToString();

            _inMemoryWebServer.Start();
        }