Example #1
0
        public void Connect_returns_connection()
        {
            string modelId = fixture.Create("modelId");
            IConnection <string, FakeModel> actual = sut.Connect(modelId);

            actual.Should().NotBeNull();
            actual.ModelId.Should().Be(modelId);
        }
        public void Emit_relays_observable_with_future()
        {
            var model   = new FakeModel();
            var store   = new StreamStore <Guid, FakeModel>();
            var functor = Mock.Of <IFunctor>();

            store.Connect(model.Id).Stream.Subscribe(functor.Action);
            IConnection <Guid, FakeModel> connection = store.Connect(model.Id);

            connection.Emit(Task.FromResult(model));

            Mock.Get(functor).Verify(x => x.Action(model), Times.Once());
        }