protected void SetUp() { Test test = new Test("Default", 0, 0, 0, 0, 0); Configuration.Initialize(test); _workorder = Substitute.For <IWork>(); _workorder.CurrentOpType.Returns(Op.OpTypes.DrillOpType1); _workorder.CurrentOpSetupTime.Returns(0); _workorder.CurrentOpEstTimeToComplete.Returns(1); _workorder.Id.Returns(1); ISchedulePlants ps = Substitute.For <ISchedulePlants>(); ps.ValidateWoForMachines(Arg.Any <int>(), Arg.Any <string>()).Returns(x => x[0]); _plant = Substitute.For <IPlant>(); _plant.PlantScheduler.Returns(ps); _bigData = Substitute.For <IHandleBigData>(); _bigData.IsBreakdown(Arg.Any <string>(), Arg.Any <DayTime>()).Returns(x => x[1]); _bigData.IsNonConformance(Arg.Any <string>()).Returns(false); _mes = Substitute.For <IMes>(); _dayTime = new DayTime(); _subject = new Workcenter("TestWC", Machine.Types.BigDrill); _subject.SetMes(_mes); _subject.AddPlant(_plant); _subject.AddBigData(_bigData); }
protected void SetUp() { _plant1 = Substitute.For <IPlant>(); _plant1.Name.Returns(PLANT1_NAME); IMes mes1 = Substitute.For <IMes>(); ISchedulePlants isp1 = Substitute.For <ISchedulePlants>(); _plant1.Mes.Returns(mes1); _plant1.PlantScheduler.Returns(isp1); _plant1.Workcenters.Returns(new List <IAcceptWorkorders>()); _plant2 = Substitute.For <IPlant>(); _plant2.Name.Returns(PLANT2_NAME); IMes mes2 = Substitute.For <IMes>(); ISchedulePlants isp2 = Substitute.For <ISchedulePlants>(); _plant2.Mes.Returns(mes2); _plant2.PlantScheduler.Returns(isp2); _plant2.Workcenters.Returns(new List <IAcceptWorkorders>()); List <IPlant> list = new List <IPlant>() { _plant1, _plant2 }; _subject = new Erp(ERP_NAME); _subject.Add(_plant1); _subject.Add(_plant2); }
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 SetMes(IMes mes) { if (_mes != null) { return; } _mes = mes; }
public Workcenter(string name, Machine.Types machineType) { Machine = new Machine("Machine " + name, machineType); Name = name; OutputBuffer = new NeoQueue(); Inspection = new Quality(); _mes = null; _bigData = null; }
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 SetMes(IMes mes) { return; }