public Transaction(string itemName, string itemColor = "", int itemSizeInInches = 0) { ItemName = itemName; Color = itemColor; SizeInInches = itemSizeInInches; ProductData = inventoryBase.FindItemRecord(ItemName, Color, SizeInInches); IsDigital = itemName.Contains("STL File"); }
public void AddImage_test() { var sut = new AirtableItemLookup(); var product = sut.FindItemRecord("zzz - dummy item", "", 0); sut.AddImageToProduct(product, "https://i.etsystatic.com/14966514/d/il/dbb99f/2210030945/il_75x75.2210030945_k8h3.jpg?version=0"); }
public void CreateTransaction() { AirtableTransactions ATbase = new AirtableTransactions(); var productName = "zzz - dummy item"; var sut = new AirtableItemLookup(); var order = ATbase.NewTransactionData(sut.FindItemRecord(productName)); order.Quantity = 5; //order.Item ="zzz - dummy item"; ATbase.CreateOrderRecord(order); }
public void ItemInventory() { var materials = new AirtableItemLookup(); var components = new List <InventoryComponent>(); var product = materials.FindItemRecord("zzz - dummy item", "purple", 6); var componentData = materials.GetComponentByName("ZZZ - Dummy Component"); var originalQuantity = componentData.Quantity; bool value = materials.UpdateInventoryCountForTransaction(product, 10, out components); Assert.Single(components); Assert.Equal("ZZZ - Dummy Component", components[0].Name); componentData = materials.GetComponentByName("ZZZ - Dummy Component"); Assert.Equal(originalQuantity - 10, componentData.Quantity); // Assert.Equal(componentData.IsBelowThreshhold()) }
public void GetInventoryItem() { var materials = new AirtableItemLookup(); var product = materials.FindItemRecord("zzz - dummy item"); var component = materials.GetComponentByName("ZZZ - Dummy Component"); Assert.Equal("Dummy Item (test)", product.DisplayName); Assert.Equal("www.dummyurl.com", product.BaseUrl); List <string> printers; string preferredPrinter; bool value = materials.GetPotentialPrintersList(product, out printers, out preferredPrinter); value = materials.GetPreferredShipper(product, out string preferredShipper); preferredPrinter = materials.GetPreferredPrinter(product); Assert.True(printers.Count > 0); Assert.Equal("Kyle Perkuhn", preferredPrinter); value = materials.GetPotentialPrintersList(component, out printers, out preferredPrinter); preferredPrinter = materials.GetPreferredPrinter(component); Assert.True(printers.Count > 0); Assert.Equal("Al Billington", preferredPrinter); }