public StarsHttpClientV1Test() { _persistence = new StarsMemoryPersistence(); _controller = new StarsController(); _client = new StarsHttpClientV1(); _service = new StarsHttpServiceV1(); IReferences references = References.FromTuples( new Descriptor("stars", "persistence", "memory", "default", "1.0"), _persistence, new Descriptor("stars", "controller", "default", "default", "1.0"), _controller, new Descriptor("stars", "client", "http", "default", "1.0"), _client, new Descriptor("stars", "service", "http", "default", "1.0"), _service ); _controller.SetReferences(references); _service.Configure(HttpConfig); _service.SetReferences(references); _client.Configure(HttpConfig); _client.SetReferences(references); _fixture = new StarsClientV1Fixture(_client); _service.OpenAsync(null).Wait(); _client.OpenAsync(null).Wait(); }
public StarsHttpServiceV1Test() { _persistence = new StarsMemoryPersistence(); _controller = new StarsController(); _service = new StarsHttpServiceV1(); IReferences references = References.FromTuples( new Descriptor("stars", "persistence", "memory", "default", "1.0"), _persistence, new Descriptor("stars", "controller", "default", "default", "1.0"), _controller, new Descriptor("stars", "service", "http", "default", "1.0"), _service ); _controller.SetReferences(references); _service.Configure(HttpConfig); _service.SetReferences(references); //_service.OpenAsync(null).Wait(); // Todo: This is defect! Open shall not block the tread Task.Run(() => _service.OpenAsync(null)); Thread.Sleep(1000); // Just let service a sec to be initialized }