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); }
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); }
void TryRemove(InMemoryTimeoutPersister inMemoryTimeoutPersister) { TimeoutData timeout; inMemoryTimeoutPersister.TryRemove(Thread.CurrentThread.Name, out timeout); }