public void CreateSubscriptionDetail() { logic = new SubscriptionTypeLogic(); proLogic = new ProductLogic(); var proList = proLogic.GetProducts(); var sub = logic.GetSubscriptionType(); if (proList.Count > 0 && sub.Count > 0) { var proId = proList.FirstOrDefault(p => p.ProductCode.ToUpper() == "PRO-01").Id; var subscriptioinTypeId = sub.FirstOrDefault(s => s.Name == "Sub1").Id; SubscriptionDetails detail = new SubscriptionDetails(); detail.ProductId = proId; detail.SubscriptionTypeId = subscriptioinTypeId; detail.Quantity = 4; List <SubscriptionDetails> details = new List <SubscriptionDetails>(); details.Add(detail); var status = detailLogic.CreateSubscriptionDetails(details); Assert.IsTrue(status); } else { Assert.Fail("No Subscription and Product Details created"); } }
public void AddCartItem() { var sub = subTypeLogic.GetSubscriptionType(); if (sub.Count > 0) { var obj = sub.FirstOrDefault(s => s.Name == "Sub1"); var subscriptioinTypeId = obj.Id; var status = cartLogic.CreateCartItem(new CartItem() { Quantity = 2, SubscriptionTypeId = subscriptioinTypeId, UserId = usr.UserId, DateCreated = DateTime.Now.Date, Price = 2 * obj.Price }); Assert.IsTrue(status); } else { Assert.Fail("Subscription Type does not exist"); } }
public IHttpActionResult GetAllSubscription() { var subList = logic.GetSubscriptionType(); return(Ok(subList)); }
public void GetSubscriptions() { var typeList = logic.GetSubscriptionType(); Assert.IsNotNull(typeList); }