예제 #1
0
        protected override void SetUp()
        {
            _activator = Using(new BuiltinHandlerActivator());

            _sagas = new InMemorySagaStorage();

            Configure.With(_activator)
                .Transport(t => t.UseInMemoryTransport(new InMemNetwork(), "saga-id-correlation"))
                .Sagas(s => s.Register(c => _sagas))
                .Start();
        }
        public void DoesNotEnforceUniquenessAcrossTypes ()
        {
            var sagaStorage = new InMemorySagaStorage();

            var recycledId = "recycled-id";

            var instanceOfType1 = new Type1 {Id = Guid.NewGuid(), Revision = 0, CorrelationId = recycledId};
            var instanceOfType2 = new Type2 { Id = Guid.NewGuid(), Revision = 0, CorrelationId = recycledId };

            sagaStorage.Insert(instanceOfType1, For(typeof(Type1))).Wait();
            sagaStorage.Insert(instanceOfType2, For(typeof(Type2))).Wait();
        }