public void DeletionFails()
        {
            var mock = new Mock <IConnectionAvailability>();

            mock.SetupGet(_ => _.IsOpen).Returns(false);
            var executor = new CallbackExecutor <object>(Mock.Of <IIdGenerator>(), mock.Object, Mock.Of <IObservable <CallbackResult <object> > >());

            DeleteCallback delete = null;

            ((IObservable <DeleteCallback>)executor).Subscribe(
                deleteCallback => delete = deleteCallback);

            Assert.Throws <InvalidOperationException>(() => executor.DeleteCallback(1));
        }
        public void CallbackDeleted()
        {
            var mock = new Mock <IConnectionAvailability>();

            mock.SetupGet(_ => _.IsOpen).Returns(true);
            var executor = new CallbackExecutor <object>(Mock.Of <IIdGenerator>(), mock.Object, Mock.Of <IObservable <CallbackResult <object> > >());

            DeleteCallback delete = null;

            ((IObservable <DeleteCallback>)executor).Subscribe(
                deleteCallback => delete = deleteCallback);

            executor.DeleteCallback(1);

            Assert.Equal(1, delete.FunctionId);
        }