Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
 public async Task Cleanup()
 {
     if (_hub != null)
     {
         await _hub.Stop();
         _hub.Dispose();
         _hub = null;
     }
 }
Esempio n. 4
0
        public async Task Cleanup()
        {
            if (_hub != null)
            {
                await _hub.Stop();

                _hub.Dispose();
                _hub = null;
            }
        }
Esempio n. 5
0
        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);
        }