public void TransferInventory_FailFor_ArticleNotAllowedInShop() { //arrange var source = MaterialStockpileShop.DeepCopy(); var target = ProductStockpileShop.DeepCopy(); var item = new InventoryItem(Material1Timber, 1); //assert () => act var ex = Assert.Throws <DomainException>(() => InventoryService.Transfer(source, target, item)); Assert.That(ex.Message, Is.EqualTo(ArticleNotAllowedInShop(item.Article, target))); }
private void InitShopCategories() { TimberComponentShopCategory.Shops = TimberComponentShop.CollectToHashSet(); TimberComponentShopCategory.Articles.Add(Material1Timber); TimberComponentShopCategory.Articles.Add(Material2Foil); TimberComponentShopCategory.Articles.Add(Component1Vertical); TimberComponentShopCategory.Articles.Add(Component2Horizontal); MdfComponentShopCategory.Shops = MdfComponentShop.CollectToHashSet(); MdfComponentShopCategory.Articles.Add(Material3Mdf); MdfComponentShopCategory.Articles.Add(Material2Foil); MdfComponentShopCategory.Articles.Add(Component3MdfFiller); GlassComponentShopCategory.Articles.Add(Material4TintedGlass); GlassComponentShopCategory.Articles.Add(Component4GlassFiller); GlassComponentShopCategory.Shops = GlassComponentShop.CollectToHashSet(); ProductAssemblyShopCategory.Articles.Add(Component1Vertical); ProductAssemblyShopCategory.Articles.Add(Component2Horizontal); ProductAssemblyShopCategory.Articles.Add(Component3MdfFiller); ProductAssemblyShopCategory.Articles.Add(Component4GlassFiller); ProductAssemblyShopCategory.Articles.Add(Product1InteriorDoor); ProductAssemblyShopCategory.Articles.Add(Product2InteriorDoor); ProductAssemblyShopCategory.Articles.Add(Component1VerticalSpoiled); ProductAssemblyShopCategory.Articles.Add(Product1InteriorDoorSpoiled); ProductAssemblyShopCategory.Shops = ProductAssemblyShop.CollectToHashSet(); MaterialStockpileShopCategory.Articles.Add(Material1Timber); MaterialStockpileShopCategory.Articles.Add(Material2Foil); MaterialStockpileShopCategory.Articles.Add(Material3Mdf); MaterialStockpileShopCategory.Articles.Add(Material4TintedGlass); MaterialStockpileShopCategory.Shops = MaterialStockpileShop.CollectToHashSet(); ProductStockpileShopCategory.Articles.Add(Product1InteriorDoor); ProductStockpileShopCategory.Articles.Add(Product2InteriorDoor); ProductStockpileShopCategory.Shops = ProductStockpileShop.CollectToHashSet(); ShopCategoryToArchive.Shops = ShopToRemove.CollectToHashSet(); ShopCategoryToArchive.Articles.Add(ArticleToArchive); }