public void WhenCalledWithDefaultParameters_GivenSomeOrdersExist_ShouldReturnTheirCount()
        {
            var existingOrders = new List <Order>();

            existingOrders.Add(new Order()
            {
                Id = 2
            });
            existingOrders.Add(new Order()
            {
                Id = 3
            });
            existingOrders.Add(new Order()
            {
                Id = 1
            });

            // Arange
            var ordersRepo = MockRepository.GenerateStub <IRepository <Order> >();

            ordersRepo.Stub(x => x.TableNoTracking).Return(existingOrders.AsQueryable());

            // Act
            var cut         = new OrderApiService(ordersRepo);
            var countResult = cut.GetOrdersCount();

            // Assert
            Assert.AreEqual(existingOrders.Count, countResult);
        }
        public void WhenCalledWithDefaultParameters_GivenNoOrdersExist_ShouldReturnZero()
        {
            // Arange
            var orderRepo = MockRepository.GenerateStub <IRepository <Order> >();

            orderRepo.Stub(x => x.TableNoTracking).Return(new List <Order>().AsQueryable());

            // Act
            var cut         = new OrderApiService(orderRepo);
            var ordersCount = cut.GetOrdersCount();

            // Assert
            Assert.AreEqual(0, ordersCount);
        }