示例#1
0
        public void FixtureSetup()
        {
            var port = TestVars.AllocPortNumber();

            // SignalR
            TestSignalRServer = new TestSignalRServer(port);
            TestSignalRServer.Start();

            // Web API
            WebApiServer = new TestWebApiServer();
            ConfigureWebApiContainer(WebApiServer.Container);
            WebApiServer.Start();
            HttpClient = new HttpClient(WebApiServer.ServerHandler)
            {
                BaseAddress = WebApiServer.BaseAddress
            };

            // Notifications
            NotificationServer = new NotificationTestServer(port);
            ConfigureNotificationContainer(NotificationServer.Container);
            NotificationServer.Start();
        }
 /// <summary>
 ///     Initializes a new instance of the <see cref="TestWebApiServer" /> class.
 /// </summary>
 public TestWebApiServer()
 {
     UnityConfig.SetPerRequestManagerFactory(() => new ContainerControlledLifetimeManager());
     UnityConfig.ConfigureContainer();
     BaseAddress = new Uri("http://localhost:" + TestVars.AllocPortNumber());
 }