public async Task Initialize() { _hub = _hubFactory.Create(); _hub.GetEvent <Common.Dto.Identity, Common.Dto.Identity, Common.Dto.Observation>("Observation").Subscribe(tuple => Observation(tuple.Item1, tuple.Item2, tuple.Item3)); await _hub.Start(); }
public async Task Initialize() { _hub = _hubFactory.Create(); _hub.GetEvent<Common.Dto.Identity, Common.Dto.Identity, Common.Dto.Observation>("Observation").Subscribe(tuple => Observation(tuple.Item1, tuple.Item2, tuple.Item3)); await _hub.Start(); }
public async Task Cleanup() { if (_hub != null) { await _hub.Stop(); _hub.Dispose(); _hub = null; } }
private async Task RunTest(Func <Hub.IFactory, Hub.IInstance, Registration.IFactory, Endpoint, Task> test) { Hub.IInstance hub = A.Fake <Hub.IInstance>(); A.CallTo(() => hub.Start()).Returns(TaskEx.Done); Hub.IFactory hubFactory = A.Fake <Hub.IFactory>(); A.CallTo(() => hubFactory.Create()).Returns(hub); Registration.IFactory registrationFactory = A.Fake <Registration.IFactory>(); Endpoint subject = new Endpoint(hubFactory, registrationFactory); await test(hubFactory, hub, registrationFactory, subject); }