public CustomersController(IBeautyStoreBL bsbl, ILogger <HomeController> logger, BeautyStoreDBContext context) { _beautyStoreBL = bsbl; // _mapper = mapper; _logger = logger; _context = context; }
public void UpdateInventoryShouldUpdateInventory() { using (var context = new BeautyStoreDBContext(options)) { //Arrange IBeautyStoreRepo repo = new BSRepoDB(context); Inventory inventory = new Inventory() { InventoriesId = 1, Quantity = 10, LocationId = 1, // ProductId = 1 }; //Act repo.ReplenishInventory(inventory); } using (var assertContext = new BeautyStoreDBContext(options)) { var result = assertContext.Inventories.FirstOrDefault(c => c.InventoriesId == 1); Assert.NotNull(result); Assert.Equal(10, result.Quantity); } }
// private BSRepoDB _BSRepoDB; public AccountController(SignInManager <IdentityUser> signinManager, BeautyStoreDBContext context, ILogger <IdentityUser> logger, UserManager <IdentityUser> _userManager, RoleManager <IdentityRole> roleManager) { _signinManager = signinManager; _logger = logger; userManager = _userManager; this.roleManager = roleManager; _context = context; // _BSRepoDB = bsRepoDb; }
public void GetCustomerByEmailReturnsCorrectCustomer() { using (var context = new BeautyStoreDBContext(options)) { //Arrange IBeautyStoreRepo repo = new BSRepoDB(context); //Act var customer = repo.GetCustomerByEmail("*****@*****.**"); Assert.Equal(1, customer.CustomerID); } }
public void GetCustomersShouldReturnAllCustomers() { using (var context = new BeautyStoreDBContext(options)) { //Arrange IBeautyStoreRepo repo = new BSRepoDB(context); //Act var customers = repo.GetCustomers(); Assert.Equal(3, customers.Count); } }
public void GetProductByIdReturnsCorrectProduct() { using (var context = new BeautyStoreDBContext(options)) { //Arrange IBeautyStoreRepo repo = new BSRepoDB(context); //Act var product = repo.GetProductByID(1); Assert.Equal("6", product.ProductName); } }
public void GetProductsReturnsAllProjects() { using (var context = new BeautyStoreDBContext(options)) { //Arrange IBeautyStoreRepo repo = new BSRepoDB(context); //Act var products = repo.GetProducts(); Assert.Equal(3, products.Count); } }
public void GetLocationsReturnsAllLocations() { using (var context = new BeautyStoreDBContext(options)) { //Arrange IBeautyStoreRepo repo = new BSRepoDB(context); //Act var locations = repo.GetLocations(); Assert.Equal(3, locations.Count); } }
public void GetItemsReturnsAllItems() { using (var context = new BeautyStoreDBContext(options)) { //Arrange IBeautyStoreRepo repo = new BSRepoDB(context); //Act var items = repo.GetItems(); Assert.Equal(12, items.Count); } }
public void GetOrdersReturnsAllOrders() { using (var context = new BeautyStoreDBContext(options)) { //Arrange IBeautyStoreRepo repo = new BSRepoDB(context); //Act var orders = repo.GetOrders(); Assert.Equal(6, orders.Count); } }
public void GetOrdersByLocationReturnsCorrectOrder() { using (var context = new BeautyStoreDBContext(options)) { //Arrange IBeautyStoreRepo repo = new BSRepoDB(context); //Act var orders = repo.GetOrdersByLocation("CA"); Assert.NotNull(orders); Assert.Equal(2, orders.Count); } }
public void GetOrdersByCustomerReturnsCorrectOrder() { using (var context = new BeautyStoreDBContext(options)) { //Arrange IBeautyStoreRepo repo = new BSRepoDB(context); //Act var orders = repo.GetOrdersByCustomer("Calvin"); Assert.NotNull(orders); Assert.Single(orders); } }
public void CustomerExistsReturnsCorrectly() { using (var context = new BeautyStoreDBContext(options)) { //Arrange IBeautyStoreRepo repo = new BSRepoDB(context); //Act bool test1 = repo.CustomerExists("*****@*****.**"); bool test2 = repo.CustomerExists("*****@*****.**"); Assert.True(test1); Assert.False(test2); } }
public void AddCustomerShouldAddCustomer() { using (var context = new BeautyStoreDBContext(options)) { IBeautyStoreRepo repo = new BSRepoDB(context); repo.AddCustomer ( new Customer { CustomerName = "Angela", HomeAddress = "123 um rd", PhoneNumber = "1236549870", EmailAddress = "*****@*****.**" } ); } using (var assertContext = new BeautyStoreDBContext(options)) { var result = assertContext.Customers.FirstOrDefault(c => c.CustomerName.Equals("testname")); Assert.NotNull(result); Assert.Equal("testname", result.CustomerName); } }
public InventoriesController(BeautyStoreDBContext context) { _context = context; }
public BeautyProductsController(BeautyStoreDBContext context) { _context = context; }
public AdminPanelController(BeautyStoreDBContext context) { _context = context; }
public LocationsController(BeautyStoreDBContext context) { _context = context; }