public BeaconsHttpClientV1Test() { _persistence = new BeaconsMemoryPersistence(); _controller = new BeaconsController(); _client = new BeaconsHttpClientV1(); _service = new BeaconsHttpServiceV1(); IReferences references = References.FromTuples( new Descriptor("pip-samples-beacons", "persistence", "memory", "default", "1.0"), _persistence, new Descriptor("pip-samples-beacons", "controller", "default", "default", "1.0"), _controller, new Descriptor("pip-samples-beacons", "client", "http", "default", "1.0"), _client, new Descriptor("pip-samples-beacons", "service", "http", "default", "1.0"), _service ); _controller.SetReferences(references); _service.Configure(HttpConfig); _service.SetReferences(references); _client.Configure(HttpConfig); _client.SetReferences(references); _fixture = new BeaconsClientV1Fixture(_client); _service.OpenAsync(null).Wait(); _client.OpenAsync(null).Wait(); }
public BeaconsHttpServiceV1Test() { _persistence = new BeaconsMemoryPersistence(); _controller = new BeaconsController(); _service = new BeaconsHttpServiceV1(); _client = new TestCommandableHttpClient("v1/beacons"); IReferences references = References.FromTuples( new Descriptor("beacons", "persistence", "memory", "default", "1.0"), _persistence, new Descriptor("beacons", "controller", "default", "default", "1.0"), _controller, new Descriptor("beacons", "service", "http", "default", "1.0"), _service, new Descriptor("beacons", "client", "http", "default", "1.0"), _client ); _controller.SetReferences(references); _service.Configure(HttpConfig); _service.SetReferences(references); _client.Configure(HttpConfig); _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 _client.OpenAsync(null).Wait(); }
public BeaconsControllerTest() { var references = new References(); _controller = new BeaconsController(); _persistence = new BeaconsMemoryPersistence(); _persistence.Configure(new ConfigParams()); references.Put(new Descriptor("pip-samples-beacons", "persistence", "memory", "*", "1.0"), _persistence); references.Put(new Descriptor("pip-samples-beacons", "controller", "default", "*", "1.0"), _controller); _controller.SetReferences(references); }
public BeaconsDirectClientV1Test() { _persistence = new BeaconsMemoryPersistence(); _controller = new BeaconsController(); _client = new BeaconsDirectClientV1(); IReferences references = References.FromTuples( new Descriptor("beacons", "persistence", "memory", "default", "1.0"), _persistence, new Descriptor("beacons", "controller", "default", "default", "1.0"), _controller, new Descriptor("beacons", "client", "direct", "default", "1.0"), _client ); _controller.SetReferences(references); _client.SetReferences(references); _fixture = new BeaconsClientV1Fixture(_client); _client.OpenAsync(null).Wait(); }