public void Contains_Susbscriptor()
        {
            var identification = new Identification { Id = "A", Type = "B" };
            var subscriptor = new Subscriptor
            {
                Service = identification,
                ServiceInputControlGateway = _mockGateWayControl.Object,
                ServiceInputGateway = _mockGateWayMessageBus.Object
            };

            using (var subject = new MemorySubscriptorsRepository())
            {
                subject.Add(subscriptor);
                Assert.IsTrue(subject.Contains(identification));
            }
        }
        public void Dispose_Susbscriptor()
        {
            var identification = new Identification { Id = "A", Type = "B" };
            var subscriptor = new Subscriptor
            {
                Service = identification,
                ServiceInputControlGateway = _mockGateWayControl.Object,
                ServiceInputGateway = _mockGateWayMessageBus.Object
            };

            using (var subject = new MemorySubscriptorsRepository())
            {
                subject.Add(subscriptor);
            }

            _mockGateWayMessageBus.Verify(x => x.Dispose());
            _mockGateWayControl.Verify(x => x.Dispose());
        }
        public void GetAll_Susbscriptor()
        {
            var identification = new Identification { Id = "A", Type = "B" };
            var subscriptor = new Subscriptor
            {
                Service = identification,
                ServiceInputControlGateway = _mockGateWayControl.Object,
                ServiceInputGateway = _mockGateWayMessageBus.Object
            };

            var identification2 = new Identification { Id = "C", Type = "C" };
            var subscriptor2 = new Subscriptor
            {
                Service = identification2,
                ServiceInputControlGateway = _mockGateWayControl.Object,
                ServiceInputGateway = _mockGateWayMessageBus.Object
            };

            using (var subject = new MemorySubscriptorsRepository())
            {
                subject.Add(subscriptor);
                subject.Add(subscriptor2);

                var subscriptors = subject.GetAll();

                Assert.IsTrue(subscriptors.Count() == 2);
            }
        }
 public void SetUp()
 {
     _subject = new MemorySubscriptorsRepository();
     _mockGateWayMessageBus = new Mock<IOutputGateway<byte[]>>();
     _mockGateWayControl = new Mock<IOutputGateway<IControlMessage>>();
 }