Ejemplo n.º 1
0
        public void Enqueue_Dequeue_Add_Customer_To_Queue_And_Retrieves_Accordingly()
        {
            var customer1 = new CustomerForTest();
            var customer2 = new CustomerForTest();

            _customersQueue.Enqueue(customer1);
            _customersQueue.Enqueue(customer2);

            Assert.That(_customersQueue.Dequeue(), Is.EqualTo(customer1));
            Assert.That(_customersQueue.Dequeue(), Is.EqualTo(customer2));
        }
Ejemplo n.º 2
0
        public void Initialize_Queue_From_Repository()
        {
            var defaultList = new List <CustomerForTest> {
                new CustomerForTest(), new CustomerForTest()
            };

            _repository.GetAll().Returns(defaultList);
            _customersQueue = new PersistenceCustomersQueue <CustomerForTest>(_repository);

            var first  = _customersQueue.Dequeue();
            var second = _customersQueue.Dequeue();

            Assert.That(first, Is.EqualTo(defaultList[0]));
            Assert.That(second, Is.EqualTo(defaultList[1]));
        }