コード例 #1
0
        public void SetNumOfGuitarsTest()
        {
            CustomerStorelocationProductsViewModel c = new CustomerStorelocationProductsViewModel();

            c.SetNumOfGuitars(3);
            Assert.True(c.numOfGuitars == 3);
        }
コード例 #2
0
 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);
 }