Пример #1
0
        public void when_get()
        {
            var manager = new DuplicationManager();
            var memory1 = manager.GetOrAdd("dispatcher");
            var memory2 = manager.GetOrAdd("dispatcher");

            Assert.AreEqual(memory1, memory2);
        }
        public void when_dispatch_dublicate_message()
        {
            ActionCalled = false;
            var dublicationMemeory = _duplicationManager.GetOrAdd(_envelopeDispatcher);

            dublicationMemeory.Memorize("EnvId");

            _envelopeDispatcher.Dispatch(Encoding.UTF8.GetBytes("test queue"));

            Assert.IsFalse(ActionCalled);
            Assert.IsFalse(_testEnvelopeQuarantine.CallQuarantineMethod);
        }