public static void RunScenarios()
        {
            using (new SampleScenarioScope(MethodBase.GetCurrentMethod().DeclaringType.Name))
            {
                var partial = $"{Guid.NewGuid():N}".Substring(0, 3);

                _categoryName = $"SellableItemUXCategory{partial}";
                _product1Name = $"ConsoleProduct1{partial}";
                _product2Name = $"ConsoleProduct2{partial}";
                _variant1Name = $"ConsoleVariant1{partial}";

                _categoryId = _categoryName.ToEntityId <Category>(CatalogName);
                _product1Id = _product1Name.ToEntityId <SellableItem>();
                _product2Id = _product2Name.ToEntityId <SellableItem>();

                EngineExtensions.AddCategory(_categoryId, CatalogId, CatalogName);
                AddSellableItemToCatalog();
                AddSellableItemToCategory();
                AddSellableItemVariant();
                DisableSellableItemVariant();
                EnableSellableItemVariant();
                DeleteSellableItemVariant();
                AssociateSellableItemToCatalog();
                AssociateSellableItemToCategory();
                DissassociateSellableItemFromCatalog();
                DissassociateSellableItemFromCategory();
                AddSellableItemImage();
                RemoveSellableItemImage();
                EngineExtensions.DeleteSellableItem(_product1Id, _categoryId, _categoryName, CatalogName);
                EngineExtensions.DeleteSellableItem(_product2Id, _categoryId, _categoryName, CatalogName);
                EngineExtensions.DeleteCategory(_categoryId);
            }
        }
예제 #2
0
 private static void AddCategoryToCategory()
 {
     using (new SampleMethodScope())
     {
         EngineExtensions.AssertCategoryExists(_parentCategoryId);
         EngineExtensions.AddCategory(_childCategoryId, _parentCategoryId, _parentCategoryName);
     }
 }
 private static void AddCategoryToCatalog()
 {
     using (new SampleMethodScope())
     {
         EngineExtensions.AssertCatalogExists(CatalogId);
         EngineExtensions.AddCategory(ParentCategoryId, CatalogId, CatalogName);
     }
 }
 public static void RunScenarios()
 {
     using (new SampleScenarioScope(MethodBase.GetCurrentMethod().DeclaringType.Name))
     {
         EngineExtensions.AddCategory(CategoryId, CatalogId, CatalogName);
         AddSellableItemToCatalog();
         AddSellableItemToCategory();
         AddSellableItemVariant();
         DisableSellableItemVariant();
         EnableSellableItemVariant();
         DeleteSellableItemVariant();
         AssociateSellableItemToCatalog();
         AssociateSellableItemToCategory();
         DissassociateSellableItemFromCatalog();
         DissassociateSellableItemFromCategory();
         AddSellableItemImage();
         RemoveSellableItemImage();
         EngineExtensions.DeleteSellableItem(Product1Id, CategoryId, CategoryName, CatalogName);
         EngineExtensions.DeleteSellableItem(Product2Id, CategoryId, CategoryName, CatalogName);
         EngineExtensions.DeleteCategory(CategoryId);
     }
 }