public void SetNumOfCasesTest() { CustomerStorelocationProductsViewModel c = new CustomerStorelocationProductsViewModel(); c.SetNumOfCases(3); Assert.True(c.numOfCases == 3); }
public CustomerStorelocationProductsViewModel SetNumOfProductsAndIds(CustomerStorelocationProductsViewModel c) { foreach (var item in allProducts) { if (item.productName == "Guitar") { foreach (var x in currentStoreInventory) { if (x.productId == item.ProductId) { c.SetNumOfGuitars(x.quantity); } } } if (item.productName == "Amplifier") { foreach (var x in currentStoreInventory) { if (x.productId == item.ProductId) { c.SetNumOfAmplifiers(x.quantity); } } } if (item.productName == "Strings") { foreach (var x in currentStoreInventory) { if (x.productId == item.ProductId) { c.SetNumOfStrings(x.quantity); } } } if (item.productName == "Case") { foreach (var x in currentStoreInventory) { if (x.productId == item.ProductId) { c.SetNumOfCases(x.quantity); } } } } try { c.SetCustomerId(loggedInCustBLC.CustomerId); } catch (Exception e) { } c.SetStoreId(currentStore.StoreId); return(c); }