public void when_not_contains_key()
        {
            var memory = new DuplicationMemory();
            var result = memory.DoWeRemember("MemId");

            Assert.IsFalse(result);
        }
        public void when_exist_key()
        {
            var memory = new DuplicationMemory();
            memory.Memorize("MemId");
            var result = memory.DoWeRemember("MemId");

            Assert.IsTrue(result);
        }
Ejemplo n.º 3
0
 public EnvelopeDispatcher(Action <ImmutableEnvelope> action, IEnvelopeStreamer streamer, IEnvelopeQuarantine quarantine, DuplicationManager manager, string dispatcherName)
 {
     this._action         = action;
     this._quarantine     = quarantine;
     this._dispatcherName = dispatcherName;
     this._manager        = manager.GetOrAdd(this);
     this._streamer       = streamer;
 }
Ejemplo n.º 4
0
 public EnvelopeDispatcher(Action<ImmutableEnvelope> action, IEnvelopeStreamer streamer, IEnvelopeQuarantine quarantine, DuplicationManager manager, string dispatcherName)
 {
     _action = action;
     _quarantine = quarantine;
     _dispatcherName = dispatcherName;
     _manager = manager.GetOrAdd(this);
     _streamer = streamer;
 }
        public void when_forget_older()
        {
            var memory = new DuplicationMemory();
            memory.Memorize("MemId");
            memory.ForgetOlderThan(new TimeSpan(0));
            var result = memory.DoWeRemember("MemId");

            Assert.IsFalse(result);
        }