コード例 #1
0
ファイル: FakeOrderItems.cs プロジェクト: haithemaraissia/PC
 public OrderItem GetClient1FirstOrderSecondOrderItem()
 {
     var secondOrderDetail = new OrderItem
     {
         OrderId = 1,
         CookerId = 1,
         Description = "Home made pasta, ground beef, tomato sauce, bechamel sauce and parmesan.",
         DishId = 3,
         Instructions = "Put Extra Spices",
         MenuId = 1,
         OrderItemId = 2,
         Quantity = 1
     };
     secondOrderDetail.OrderItemDishOptions.Add(new FakeOrderItemDishOptions().ThirdOrderItemDishOption());
     return secondOrderDetail;
 }
コード例 #2
0
ファイル: FakeOrderItems.cs プロジェクト: haithemaraissia/PC
        //OrderId =2
        public OrderItem GetClient2FirstOrderFirstOrderItem()
        {
            var firstOrderDetail = new OrderItem
            {
                OrderId = 2,
                CookerId = 1,
                Description = "Includes six pieces.",
                DishId = 4,
                Instructions = null,
                MenuId = 1,
                OrderItemId = 3,
                Quantity = 1
            };

            firstOrderDetail.OrderItemDishOptions.Add(new FakeOrderItemDishOptions().FourthOrderItemDishOption());
            return firstOrderDetail;
        }
コード例 #3
0
ファイル: FakeOrderItems.cs プロジェクト: haithemaraissia/PC
        //OrderId = 1
        public OrderItem GetClient1FirstOrderFirstOrderItem()
        {
            var firstOrderDetail = new OrderItem
            {
                OrderId = 1,
                CookerId = 1,
                Description = "Chicken sauteed with roasted red peppers in our marinara sauce with provolone cheese. Served on fresh white Italian braided rolls topped with sesame seeds.",
                DishId = 1,
                Instructions = "Put Extra French Fries",
                MenuId = 1,
                OrderItemId = 1,
                Quantity = 2
            };

            firstOrderDetail.OrderItemDishOptions.Add(new FakeOrderItemDishOptions().FirstOrderItemDishOption());
            firstOrderDetail.OrderItemDishOptions.Add(new FakeOrderItemDishOptions().SecondOrderItemDishOption());
            return firstOrderDetail;
        }
コード例 #4
0
        private OrderItem GetFirstOrderItem()
        {
            var firstOrderDetail = new OrderItem
            {
                CookerId = 1,
                Description = "Chicken sauteed with roasted red peppers in our marinara sauce with provolone cheese. Served on fresh white Italian braided rolls topped with sesame seeds.",
                DishId = 1,
                Instructions = "Put Extra French Fries",
                MenuId = 1,
                OrderItemId = 1,
                Quantity = 2
            };

            //Required Side
            var firstOrderDetailOption = new OrderItemDishOption
            {
                OrderItemDishOptionId = 1,
                DishOptionChoiceId = 3,
                DishOptionChoiceValue = "Cucumber Salad",
                Price = (decimal?)2.09,
                CurrencyId = 1,
                DishOptionId = (int)DishOptionType.Values.FakeRequiredSideTwelveOptionChoices,
                Instructions = "no Mayone Please",
                OrderItemId = 1
            };

            //Optional Side
            var secondOrderDetailOption = new OrderItemDishOption
            {
                OrderItemDishOptionId = 2,
                DishOptionChoiceId = 17,
                DishOptionChoiceValue = "House Salad",
                Price = null,
                CurrencyId = null,
                DishOptionId = (int)DishOptionType.Values.FakeOptionalSideThreeOptionChoices,
                Instructions = "More Lettuce",
                OrderItemId = 1
            };
            firstOrderDetail.OrderItemDishOptions.Add(firstOrderDetailOption);
            firstOrderDetail.OrderItemDishOptions.Add(secondOrderDetailOption);
            return firstOrderDetail;
        }
コード例 #5
0
        private OrderItem GetSecondOrderItem()
        {
            var secondOrderDetail = new OrderItem
            {
                CookerId = 1,
                Description = "Home made pasta, ground beef, tomato sauce, bechamel sauce and parmesan.",
                DishId = 3,
                Instructions = "Put Extra Spices",
                MenuId = 1,
                OrderItemId = 2,
                Quantity = 1
            };

            //Required Side
            var firstOrderDetailOption = new OrderItemDishOption
            {
                OrderItemDishOptionId = 3,
                DishOptionChoiceId = 14,
                DishOptionChoiceValue = "New York Strip Steak",
                Price = (decimal?)8.97,
                CurrencyId = 1,
                DishOptionId = (int)DishOptionType.Values.FakeRequiredSideThreeOptionChoices,
                Instructions = "no Mayone Please",
                OrderItemId = 2
            };
            secondOrderDetail.OrderItemDishOptions.Add(firstOrderDetailOption);
            return secondOrderDetail;
        }
コード例 #6
0
ファイル: FakeOrderItems.cs プロジェクト: haithemaraissia/PC
 //OrderId =3
 public OrderItem GetClient3FirstOrderFirstOrderItem()
 {
     var firstOrderDetail = new OrderItem
     {
         OrderId = 2,
         CookerId = 3,
         Description = "Saag Pea Soup",
         DishId = 32,
         Instructions = null,
         MenuId = 7,
         OrderItemId = 5,
         Quantity = 1
     };
     return firstOrderDetail;
 }
コード例 #7
0
        private OrderItem GetOrderItem()
        {
            var orderDetail = new OrderItem
            {
                OrderId = _uow.OrderRepository.All.ToList().Max(x => x.OrderId) + 1,
                CookerId = 1,
                Description = "Includes six pieces.",
                DishId = 4,
                Instructions = null,
                MenuId = 1,
                OrderItemId = _uow.OrderItemRepository.All.ToList().Max(x => x.OrderItemId) + 1,
                Quantity = 2
            };

            orderDetail.OrderItemDishOptions.Add(GetItemDishOption());
            _uow.OrderItemRepository.Add(orderDetail);
            _uow.OrderItemDishOptionRepository.Add(GetItemDishOption());
            _uow.Save();
            return orderDetail;
        }
コード例 #8
0
        //OrderId =2
        public OrderItem GetClient2FirstOrderFirstOrderItem()
        {
            var firstOrderDetail = new OrderItem
            {
                CookerId = 1,
                Description = "Includes six pieces.",
                DishId = 4,
                Instructions = null,
                MenuId = 1,
                OrderItemId = 3,
                Quantity = 1
            };

            //Optional Side
            var firstOrderDetailOption = new OrderItemDishOption
            {
                OrderItemDishOptionId = 3,
                DishOptionChoiceId = 20,
                DishOptionChoiceValue = "Extra Dressing",
                Price = (decimal?)0.53,
                CurrencyId = (int)CurrencyType.Values.Usd,
                DishOptionId = (int)DishOptionType.Values.FakeOptionalSideFourOptionChoices,
                Instructions = "no Mayone Please",
                OrderItemId = 3
            };
            firstOrderDetail.OrderItemDishOptions.Add(firstOrderDetailOption);
            return firstOrderDetail;
        }
コード例 #9
0
 private CookerOrderToReview CreateCookerOrderToReview(OrderItem orderItem)
 {
     Assert.AreEqual(0, _uow.CookerOrderToReviewRepository.FindBy(x => x.OrderId == orderItem.OrderId).Count());
     // Cooker Order to Review
     var cookerOrderToReview = new CookerOrderToReview
     {
         CookerOrderToReviewId = _uow.CookerOrderToReviewRepository.All.ToList().Max(x => x.CookerOrderToReviewId) + 1,
         ClientId = 2,
         CookerId = orderItem.CookerId,
         MenuId = orderItem.MenuId,
         OrderId = orderItem.OrderId,
         OverallFeedBackRating = 0,
         ItemAccuracyRating = 0,
         CommunicationRating = 0,
         DeliveryTimeRating = 0,
         Comment = null,
         Photo = null,
         OrderDate = DateTime.Today.Date,
         OrderModelTypeId = (int)OrderModelType.Values.Subscription
     };
     _uow.CookerOrderToReviewRepository.Add(cookerOrderToReview);
     _uow.Save();
     Assert.AreEqual(1, _uow.CookerOrderToReviewRepository.FindBy(x => x.OrderId == orderItem.OrderId).Count());
     return cookerOrderToReview;
 }
コード例 #10
0
 private void CreateCookerOrderReviewSentToClient(OrderItem orderItem)
 {
     Assert.AreEqual(0, _uow.CookerOrderReviewSentRepository.FindBy(x => x.OrderId == orderItem.OrderId).Count());
     //Cooker Review Order
     var cookerOrderReviewSent = new CookerOrderReviewSent
     {
         CookerOrderReviewSentId =
             _uow.CookerOrderReviewSentRepository.All.ToList().Max(x => x.CookerOrderReviewSentId) + 1,
         ClientId = 2,
         CookerId = orderItem.CookerId,
         MenuId = orderItem.MenuId,
         OrderId = orderItem.OrderId,
         OverallFeedBackRating = (int)RatingCodeType.Values.Positive,
         ItemAccuracyRating = 4,
         CommunicationRating = 3,
         DeliveryTimeRating = 2,
         Comment = null,
         Photo = null,
         OrderDate = DateTime.Today.Date,
         OrderModelTypeId = (int)OrderModelType.Values.Subscription
     };
     _uow.CookerOrderReviewSentRepository.Add(cookerOrderReviewSent);
     _uow.Save();
     Assert.AreEqual(1, _uow.CookerOrderReviewSentRepository.FindBy(x => x.OrderId == orderItem.OrderId).Count());
 }
コード例 #11
0
        private void CookerReviewOrder(OrderItem orderItem)
        {
            var cookerOrderToReview = CreateCookerOrderToReview(orderItem);
            CreateCookerOrderReviewSentToClient(orderItem);
            var clientOrderReviewReceived = ClientOrderReviewReceived(orderItem);
            DeleteCookerOrderToReview(cookerOrderToReview);

            UpdateClientFeedBack_And_ReviewScore(clientOrderReviewReceived);
        }
コード例 #12
0
 private CookerOrderReviewReceived CookerOrderReviewReceived(OrderItem orderItem)
 {
     Assert.AreEqual(0, _uow.CookerOrderReviewReceivedRepository.FindBy(x => x.OrderId == orderItem.OrderId).Count());
     //Cooker Review Received
     var cookerOrderReviewReceived = new CookerOrderReviewReceived
     {
         CookerOrderReviewReceivedId =
             _uow.CookerOrderReviewReceivedRepository.All.ToList().Max(x => x.CookerOrderReviewReceivedId) + 1,
         CookerId = orderItem.CookerId,
         ClientId = 1,
         MenuId = orderItem.MenuId,
         OrderId = orderItem.OrderId,
         OverallFeedBackRating = (int)RatingCodeType.Values.Positive,
         ItemAccuracyRating = 4,
         CommunicationRating = 3,
         DeliveryTimeRating = 2,
         Comment = null,
         Photo = null,
         OrderDate = DateTime.Today.Date,
     };
     _uow.CookerOrderReviewReceivedRepository.Add(cookerOrderReviewReceived);
     _uow.Save();
     Assert.AreEqual(1, _uow.CookerOrderReviewReceivedRepository.FindBy(x => x.OrderId == orderItem.OrderId).Count());
     return cookerOrderReviewReceived;
 }
コード例 #13
0
        private void ClientReviewOrder(OrderItem orderItem)
        {
            var clientOrderToReview = CreateClientOrdertoReview(orderItem);
            CreateClientOrderReviewSentToCooker(orderItem);
            var cookerOrderReviewReceived = CookerOrderReviewReceived(orderItem);
            DeleteClientOrderToReview(clientOrderToReview);

            UpdateCookerFeedBack_And_ReviewScore_And_ServiceDetail(cookerOrderReviewReceived);
        }