private IPlant GeneratePlant(string name, int wonumber) { IPlant plant = Substitute.For <IPlant>(); plant.Name.Returns(name); IMes mes = Substitute.For <IMes>(); IWork wo = Substitute.For <IWork>(); Dictionary <int, IWork> dic = new Dictionary <int, IWork>(); wo.Id.Returns(wonumber); wo.Operations.Returns(new List <Op>() { new Op(Op.OpTypes.DrillOpType1) }); wo.CurrentOpIndex.Returns(1); dic.Add(wonumber, wo); mes.Workorders.Returns(dic); plant.Mes.Returns(mes); IAcceptWorkorders wc = Substitute.For <IAcceptWorkorders>(); wc.Name.Returns("Wc" + wonumber); wc.ListOfValidTypes().Returns(new List <Op.OpTypes>() { Op.OpTypes.DrillOpType1 }); plant.Workcenters.Returns(new List <IAcceptWorkorders>() { wc }); return(plant); }
public void Add(IAcceptWorkorders workcenter) { Locations.Add(workcenter.Name, new VirtualWorkcenter(workcenter.Name, workcenter.ListOfValidTypes())); LocationInventories.Add(workcenter.Name, new List <IWork>()); }