private void BuildQuanta(BluePrintInfo bluePrint) { var firstLoad = new List<ItemState>(); var subsequentLoads = new List<ItemState>(); var quantaFactor = (double)TimeRemaining; foreach (var item in bluePrint.Materials) { var quanta = new ItemState() {Code = item.Code, Quantity = (uint) System.Math.Floor(item.Quantity/quantaFactor)}; subsequentLoads.Add(quanta); firstLoad.Add(new ItemState { Code = item.Code, Quantity = item.Quantity - (uint )System.Math.Floor(quanta.Quantity * (quantaFactor - 1)) } ); } _firstLoad = firstLoad.ToArray(); _subsequentLoad = subsequentLoads.ToArray(); }
private void SetupItem(BluePrintInfo bluePrint) { var item = TestItems.BuildItem(bluePrint.Code, bluePrint.TargetQuantity); _itemFactory.Setup(f => f.Build(bluePrint.Code, bluePrint.TargetQuantity)).Returns(item); }
public bool CanUse(BluePrintInfo bluePrint) { Ensure.That(bluePrint).IsNotNull(); return CanUse(bluePrint.BuildRequirements); }
public void NewBluePrint() { var bluePrint = new BluePrintInfo(); bluePrint.BuildRequirements.ShouldBeEmpty(); bluePrint.Materials.ShouldBeEmpty(); }