public void Add(IAcceptWorkorders workcenter) { Workcenters.Add(workcenter); Mes.Add(workcenter); workcenter.SetMes(Mes); workcenter.AddPlant(this); }
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); }
protected void SetUp() { _wc1 = Substitute.For <IAcceptWorkorders>(); _wc1.Name.Returns(WC1); _wc1.ReceivesType(TYPE1).Returns(true); _wc1.ReceivesType(TYPE2).Returns(false); _wc2 = Substitute.For <IAcceptWorkorders>(); _wc2.Name.Returns(WC2); _wc2.ReceivesType(TYPE1).Returns(false); _wc2.ReceivesType(TYPE2).Returns(true); _subject = new Mes("mes"); _subject.Add(_wc1); _subject.Add(_wc2); }
protected void SetUp() { Test test = new Test("Default", 0, 0, 0, 0, 0); Configuration.Initialize(test); _mes = Substitute.For <IMes>(); _start = Substitute.For <IAcceptWorkorders>(); _start.Name.Returns("Start Location"); _destination = Substitute.For <IAcceptWorkorders>(); _destination.Name.Returns("Destination"); _destination.ReceivesType(Arg.Any <Core.Resources.Op.OpTypes>()).Returns(true); _plant = Substitute.For <IPlant>(); _plant.Mes.Returns(_mes); _plant.Workcenters.Returns(new List <IAcceptWorkorders>() { _destination, _start }); ISchedulePlants isp = Substitute.For <ISchedulePlants>(); isp.ValidateDestinationForTransport(Arg.Any <int?>(), Arg.Any <string>(), Arg.Any <string>()).Returns(x => (string)x[2]); isp.ValidateWoForTransport(Arg.Any <int?>(), Arg.Any <string>()).Returns(x => x[0]); _plant.PlantScheduler.Returns(isp); _dayTime = new DayTime(); _workorder = Substitute.For <IWork>(); _workorder.Id.Returns(WORKORDER_ID); _nQueue1 = Substitute.For <ICustomQueue>(); _nQueue1.Remove(WORKORDER_ID).Returns(_workorder); _nQueue1.Any().Returns(true); _nQueue2 = Substitute.For <ICustomQueue>(); _nQueue2.Remove(WORKORDER_ID).Returns(_workorder); _nQueue2.Any().Returns(true); _start.OutputBuffer.Returns(_nQueue1); _destination.OutputBuffer.Returns(_nQueue2); _subject = new Transportation(_start, _plant); }
public void Add(IAcceptWorkorders workcenter) { Locations.Add(workcenter.Name, new VirtualWorkcenter(workcenter.Name, workcenter.ListOfValidTypes())); LocationInventories.Add(workcenter.Name, new List <IWork>()); }
public void Add(IAcceptWorkorders workcenter) { // Don't use; }