public void FindOrdersInPageMaterializeResults()
        {
            //Arrange

            var customerRepository = new StubICustomerRepository();
            var productRepository  = new StubIProductRepository();
            var orderRepository    = new StubIOrderRepository();

            //orderRepository.GetPagedInt32Int32ExpressionOfFuncOfOrderKPropertyBoolean<DateTime>(
            //   (index, count, order, ascending) =>
            //   {
            //      var item = new Order();
            //      item.GenerateNewIdentity();
            //      item.SetTheCustomerReferenceForThisOrder(Guid.NewGuid());

            //      return new List<Order>()
            //      {
            //         item
            //      };
            //   });

            orderRepository.GetPagedOf1Int32Int32ExpressionOfFuncOfOrderM0Boolean <DateTime>(
                FindOrdersInPageMaterializeResults);

            var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository);

            //act
            var result = salesManagement.FindOrders(0, 1);

            //Assert

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Any());
        }
      public void FindOrdersWithInvalidPageIndexThrowException()
      {
         //Arrange

         var customerRepository = new StubICustomerRepository();
         var productRepository = new StubIProductRepository();
         var orderRepository = new StubIOrderRepository();
         //orderRepository.GetPagedInt32Int32ExpressionOfFuncOfOrderKPropertyBoolean<DateTime>(
         //   (index, count, order, ascending) => { return new List<Order>(); });

         orderRepository.GetPagedOf1Int32Int32ExpressionOfFuncOfOrderM0Boolean<DateTime>(
            FindOrdersWithInvalidPageIndexThrowException);

         var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository);

         //act
         var result = salesManagement.FindOrders(-1, 1);

      }
        public void FindOrdersWithInvalidPageIndexThrowException()
        {
            //Arrange

            var customerRepository = new StubICustomerRepository();
            var productRepository  = new StubIProductRepository();
            var orderRepository    = new StubIOrderRepository();

            //orderRepository.GetPagedInt32Int32ExpressionOfFuncOfOrderKPropertyBoolean<DateTime>(
            //   (index, count, order, ascending) => { return new List<Order>(); });

            orderRepository.GetPagedOf1Int32Int32ExpressionOfFuncOfOrderM0Boolean <DateTime>(
                FindOrdersWithInvalidPageIndexThrowException);

            var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository);

            //act
            var result = salesManagement.FindOrders(-1, 1);
        }
      public void FindOrdersInPageMaterializeResults()
      {
         //Arrange

         var customerRepository = new StubICustomerRepository();
         var productRepository = new StubIProductRepository();
         var orderRepository = new StubIOrderRepository();
         //orderRepository.GetPagedInt32Int32ExpressionOfFuncOfOrderKPropertyBoolean<DateTime>(
         //   (index, count, order, ascending) =>
         //   {
         //      var item = new Order();
         //      item.GenerateNewIdentity();
         //      item.SetTheCustomerReferenceForThisOrder(Guid.NewGuid());

         //      return new List<Order>()
         //      {
         //         item
         //      };
         //   });

         orderRepository.GetPagedOf1Int32Int32ExpressionOfFuncOfOrderM0Boolean<DateTime>(
            FindOrdersInPageMaterializeResults);

         var salesManagement = new SalesAppService(productRepository, orderRepository, customerRepository);

         //act
         var result = salesManagement.FindOrders(0, 1);

         //Assert

         Assert.IsNotNull(result);
         Assert.IsTrue(result.Any());

      }