コード例 #1
0
 public void When_existing_is_removed_existing_is_outted()
 {
     var persister = new InMemoryTimeoutPersister();
     var inputTimeout = new TimeoutData();
     persister.Add(inputTimeout);
     TimeoutData removedTimeout;
     var removed = persister.TryRemove(inputTimeout.Id, out removedTimeout);
     Assert.IsTrue(removed);
     Assert.AreSame(inputTimeout, removedTimeout);
 }
コード例 #2
0
        public void When_existing_is_removed_by_saga_id()
        {
            var persister = new InMemoryTimeoutPersister();
            var newGuid = Guid.NewGuid();
            var inputTimeout = new TimeoutData
                               {
                                   SagaId = newGuid
                               };
            persister.Add(inputTimeout);

            persister.RemoveTimeoutBy(newGuid);
            TimeoutData removedTimeout;
            var removed = persister.TryRemove(inputTimeout.Id, out removedTimeout);
            Assert.False(removed);
        }
コード例 #3
0
 void TryRemove(InMemoryTimeoutPersister inMemoryTimeoutPersister)
 {
     TimeoutData timeout;
     inMemoryTimeoutPersister.TryRemove(Thread.CurrentThread.Name, out timeout);
 }