public ProductsController( BasketContext context, ILogger <ProductsController> logger, IMapper mapper) { _context = context; _logger = logger; _mapper = mapper; }
public int createBasketId(BasketContext context) { int newid = random.Next(); while (checkId(context, newid)) { newid = random.Next(); } context.Baskets.Add(new Models.Basket(newid, DateTime.Now)); context.SaveChanges(); return(newid); }
private BasketContext GetContextWithData() { var options = new DbContextOptionsBuilder <BasketContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()) .Options; var context = new BasketContext(options); // add seeds context.Products.Add(new ProductModel() { SKU = "P111", Description = "Surface Phone", Price = 100, Quantity = 100 }); context.Products.Add(new ProductModel() { SKU = "P112", Description = "Surface Pro 1", Price = 120, Quantity = 200 }); context.Products.Add(new ProductModel() { SKU = "P113", Description = "Surface Pro 2", Price = 140, Quantity = 200 }); context.Products.Add(new ProductModel() { SKU = "P111", Description = "Windows10 Pro", Price = 123, Quantity = 600 }); context.Baskets.Add(new BasketRequest() { ClientId = "A111", Quantity = 5, SKU = "P111", TotalPrice = 500 }); context.Baskets.Add(new BasketRequest() { ClientId = "A111", Quantity = 1, SKU = "P112", TotalPrice = 200 }); context.Baskets.Add(new BasketRequest() { ClientId = "A115", Quantity = 1, SKU = "P112", TotalPrice = 200 }); context.SaveChanges(); return(context); }
public void BuyAProduct() { //Arrange var minpriceValueToSet = 100; var maxpriceValueToSet = 2000; var name = "‘ол≥о"; var booksResultsPage = new FilterPage(driver); var SingleBookPage = new GoodsItemPage(driver); var Basket = new BasketPage(driver); var Checkout = new CheckoutPage(driver); //Act FilteringContext.FilterByPriceRange(booksResultsPage, minpriceValueToSet, maxpriceValueToSet); FilteringContext.ClickCheckbox(booksResultsPage, name); ResultSetContext.BuyElement(booksResultsPage, 0); BasketContext.ProceedToCheckout(Basket); CheckoutContext.InputReceiverData(Checkout, "Testik", "0980000001", "*****@*****.**"); //Assert GoodStateVerificationContext.VerifyMakeOrderIsClickable(Checkout); }
public void Buy() { //Arrange var minpriceValueToSet = 100; var maxpriceValueToSet = 2000; var name = "ю-аю-аю-цю-кю-лю-цю"; int HowCanlongIwait = 15000; var booksResultsPage = new FilterPage(driver); var SingleBookPage = new GoodsItemPage(driver); var Basket = new BasketPage(driver); var Checkout = new CheckoutPage(driver); //Act FilteringContext.FilterByPriceRange(booksResultsPage, minpriceValueToSet, maxpriceValueToSet, HowCanlongIwait); FilteringContext.ClickCheckbox(booksResultsPage, name, HowCanlongIwait); ResultSetContext.BuyElement(booksResultsPage, 0, HowCanlongIwait); BasketContext.ProceedToCheckout(Basket, HowCanlongIwait); CheckoutContext.InputReceiverData(Checkout, HowCanlongIwait);//modification with volid date //Assert VerificationContext.VerifyMakeOrderIsClickable(Checkout); }
public QueueHandler(BasketContext context) { _context = context; }
public BasketItemsController(BasketContext context, IConfiguration configuration, RedisCacheClient redisCacheClient) { _context = context; _configuration = configuration; _redisCacheClient = redisCacheClient; }
public EfGenericRepository(BasketContext context) { DbContext = context; Table = DbContext.Set <T>(); }
public HttpController(BasketContext context) { _context = context; }
public BasketService(BasketContext context) { _context = context; }
public HomeController(ILogger <HomeController> logger, BasketContext basketContext) { _logger = logger; context = basketContext; }
/// <summary> /// Constructor /// </summary> /// <param name="context">The basket database context</param> public BasketAPIController(BasketContext context) { _context = context; }
public BasketRepository(BasketContext context) { this.context = context; }
public ProductController(BasketContext context) { _context = context; }
public ProductPriceChangedIntegrationEventHandler(BasketContext basketContext) { //_logger = logger ?? throw new ArgumentNullException(nameof(logger)); _basketContext = basketContext ?? throw new ArgumentNullException(nameof(basketContext)); }
public bool checkId(BasketContext context, int id) { var basket = from row in context.Baskets where row.Id == id select row; return(basket.Count() > 0); }
public BasketRepository(BasketContext appDbContext) { AppDbContext = appDbContext ?? throw new ArgumentNullException(nameof(appDbContext)); }
public CartItemsController(BasketContext context) { _context = context; }
public BasketController(BasketContext basketContext) { _basketContext = basketContext ?? throw new ArgumentNullException(nameof(basketContext)); }
public EventController(BasketContext context) { _context = context; }
public BasketController(IConfiguration configuration, BasketContext context) { this.configuration = configuration; this._context = context; }
public EfGenericRepository() { DbContext = new BasketContext(); Table = DbContext.Set <T>(); }