using System.Collections.Generic;
public static string GetFulfillmentResultMessage(List<ProductInStock> products, FulfillmentRequest request)
public static void Main(string[] args) {
Product product1 = new Product(1, "Cookies");
Product product2 = new Product(2, "Chocolate");
Product product3 = new Product(3, "Bread");
Product product4 = new Product(4, "Baguette");
List<ProductInStock> products = new List<ProductInStock>()
new ProductInStock(product1, 10, 1, 47.5),
new ProductInStock(product2, 4, 1, 55.2),
new ProductInStock(product3, 14, 2, 7.4),
new ProductInStock(product4, 7, 2, 11.7),
new ProductInStock(product2, 4, 3, 55.2),
new ProductInStock(product2, 8, 3, 55.3),
new ProductInStock(product3, 7, 4, 7.4),
new ProductInStock(product4, 7, 4, 11.7)
var testCases = new List<FulfillmentRequest>()
new FulfillmentRequest() { ProductId = 2, Quantity = 5},
new FulfillmentRequest() { ProductId = 3, Quantity = 25},
new FulfillmentRequest() { ProductId = 5, Quantity = 9}
public class FulfillmentRequest
public int ProductId { get; set; }
public int Quantity { get; set; }
public class ProductInStock
public Product Product { get; set; }
public int Quantity { get; set; }
public int BatchId { get; set; }
public double Price { get; set; }
public ProductInStock(Product product, int quantity, int batchId, double price)
public int Id { get; set; }
public string Name { get; set; }
public Product(int id, string name)