Example #1
0
        private static void AddCatalog()
        {
            using (new SampleMethodScope())
            {
                // test for validation error
                var view = Proxy.GetValue(EngineExtensions.AuthoringContainer.Value.GetEntityView(string.Empty, "Details", "AddCatalog", string.Empty));
                view.Should().NotBeNull();
                view.Policies.Should().BeEmpty();
                view.Properties.Should().NotBeEmpty();
                view.ChildViews.Should().BeEmpty();

                view.Properties = new ObservableCollection <ViewProperty>
                {
                    new ViewProperty
                    {
                        Name  = "Name",
                        Value = $"{CatalogName}$%^*&{{"
                    },
                };

                var result = Proxy.DoCommand(EngineExtensions.AuthoringContainer.Value.DoAction(view));
                result.Messages.Should().ContainMessageCode("validationerror");
                ConsoleExtensions.WriteExpectedError();

                // Create a valid catalog
                EngineExtensions.AddCatalog(CatalogName, "Console UX Catalog");
            }
        }
        public static void RunScenarios()
        {
            using (new SampleScenarioScope(nameof(InventoryUX)))
            {
                var partial = $"{Guid.NewGuid():N}".Substring(0, 3);
                _catalog1Name      = $"InventoryCatalog1{partial}";
                _catalog2Name      = $"InventoryCatalog2{partial}";
                _inventorySet1Name = $"InventorySet1{partial}";
                _inventorySet2Name = $"InventorySet2{partial}";
                _inventorySet3Name = $"InventorySet3{partial}";
                _productName       = $"InventoryUXProduct{partial}";

                _catalog1Id              = _catalog1Name.ToEntityId <Catalog>();
                _catalog2Id              = _catalog2Name.ToEntityId <Catalog>();
                _productId               = _productName.ToEntityId <SellableItem>();
                _inventorySet1Id         = _inventorySet1Name.ToEntityId <InventorySet>();
                _inventorySet2Id         = _inventorySet2Name.ToEntityId <InventorySet>();
                _inventorySet3Id         = _inventorySet3Name.ToEntityId <InventorySet>();
                _productInventoryInfo1Id = _productName.ToEntityId <InventoryInformation>(_inventorySet1Name);
                _productInventoryInfo2Id = _productName.ToEntityId <InventoryInformation>(_inventorySet2Name);
                _inventoryExportFilePath = Path.Combine(Path.GetTempPath(), "consoleinventory.zip");

                EngineExtensions.AddCatalog(_catalog1Name, $"{_catalog1Name} Display Name");
                EngineExtensions.AddCatalog(_catalog2Name, $"{_catalog2Name} Display Name");
                EngineExtensions.AddSellableItem(_productId, _catalog1Id, _catalog1Name, _catalog1Name);
                EngineExtensions.AssociateSellableItem(_productId, _catalog2Id, _catalog2Name, _catalog2Name);
                AddInventorySet();
                EditInventorySet();
                AssociateCatalogToInventorySet();
                AssociateSellableItemToInventorySet();
                EditInventoryInformation1();
                EditInventoryInformation2();
                ExportInventorySetsFull().Wait();
                TransferInventoryInformation();
                DisassociateSellableItemFromInventorySet();
                DisassociateCatalogFromInventorySet();
                ImportInventorySetsReplace().Wait();

                DeleteInventorySet();
            }
        }
Example #3
0
 public static void RunScenarios()
 {
     using (new SampleScenarioScope(nameof(InventoryUX)))
     {
         EngineExtensions.AddCatalog(Catalog1Name, $"{Catalog1Name} Display Name");
         EngineExtensions.AddCatalog(Catalog2Name, $"{Catalog2Name} Display Name");
         EngineExtensions.AddSellableItem(ProductId, Catalog1Id, Catalog1Name, Catalog1Name);
         EngineExtensions.AssociateSellableItem(ProductId, Catalog2Id, Catalog2Name, Catalog2Name);
         AddInventorySet();
         EditInventorySet();
         AssociateCatalogToInventorySet();
         AssociateSellableItemToInventorySet();
         EditInventoryInformation1();
         EditInventoryInformation2();
         ExportInventorySetsFull().Wait();
         TransferInventoryInformation();
         DisassociateSellableItemFromInventorySet();
         DisassociateCatalogFromInventorySet();
         ImportInventorySetsReplace().Wait();
         EngineExtensions.DeleteSellableItem(ProductId, Catalog1Id, Catalog1Name, Catalog1Name);
         EngineExtensions.DeleteCatalog(Catalog1Name);
     }
 }