private void CompareObjects(MountSimulatorPlcCommunication simulator, IMountStatus status)
 {
     Assert.AreEqual<string>(simulator.CassetteId, status.NewLotCassette.CassetteId);
     Assert.AreEqual<bool>(simulator.IsCassetteId, status.NewLotCassette.IsCassetteId);
     Assert.AreEqual<bool>(simulator.IsLotDataTimeout, status.IsLotDataTimeout);
     Assert.AreEqual<string>(simulator.NewLotId, status.NewLotStarted.LotId);
     Assert.AreEqual<MountLine>(simulator.Line, status.NewLotStarted.Line);
     Assert.AreEqual<bool>(simulator.IsLotStarted, status.NewLotStarted.IsLotStarted);
     Assert.AreEqual<bool>(simulator.IsCarrierPlateArrived, status.IsCarrierPlateArrived);
     Assert.AreEqual<bool>(simulator.IsCarrierPlateMountingReady, status.IsCarrierPlateMountingReady);
     Assert.AreEqual<int>(simulator.WaferBreakNumber, status.WaferBreakNumber);
     Assert.AreEqual<bool>(simulator.IsMountingCarrierPlateError, status.IsMountingErrorCarrierPlate);
     Assert.AreEqual<bool>(simulator.IsLotEnded, status.IsEndLot);
     Assert.AreEqual<bool>(simulator.IsReservationLotCanceled, status.IsReservationLotCanceled);
     Assert.AreEqual<MountState>(simulator.State, status.State);
 }
        private void CompareObjects(MountSimulatorPlcCommunication simulator, bool isCassetteIdError, string newLotId, MountLine line, bool isNewLotStarted,
            bool isBarcodeReadedOk, bool isCarrierPlateMountingReady, bool isWaferBreakInfoOk, bool isMountingCarrierPlateError, bool isLotEnded,
            bool isReservationLotCanceled, bool isInformationSystemError, ILotData lotData)
        {
            Assert.AreEqual<bool>(isCassetteIdError, simulator.IsCassetteIdError);
            Assert.AreEqual<string>(newLotId, simulator.NewLotId);
            Assert.AreEqual<MountLine>(line, simulator.Line);
            Assert.AreEqual<bool>(isNewLotStarted, simulator.IsLotStarted);
            Assert.AreEqual<bool>(isBarcodeReadedOk, simulator.IsBarcodeReadedOk);
            Assert.AreEqual<bool>(isCarrierPlateMountingReady, simulator.IsCarrierPlateMountingReady);
            Assert.AreEqual<bool>(isWaferBreakInfoOk, simulator.IsWaferBreakInfoOk);
            Assert.AreEqual<bool>(isMountingCarrierPlateError, simulator.IsMountingCarrierPlateError);
            Assert.AreEqual<bool>(isLotEnded, simulator.IsLotEnded);
            Assert.AreEqual<bool>(isReservationLotCanceled, simulator.IsReservationLotCanceled);
            Assert.AreEqual<bool>(isInformationSystemError, simulator.InformationSystemError);

            // Check lot data - START
            Assert.AreEqual<string>(lotData.LotId, simulator.LotId);
            for (int idx = 0; idx < lotData.Cassettes.Count; idx++)
            {
                Assert.AreEqual<string>(lotData.Cassettes[idx].CassetteId, simulator.Cassettes[idx].Id);
            }
            for (int idx = lotData.Cassettes.Count; idx < 12; idx++)
            {
                Assert.AreEqual<string>("", simulator.Cassettes[idx].Id);
            }
            Assert.AreEqual<int>(lotData.Cassettes.Count, simulator.CassetteQuantityInLot);
            Assert.AreEqual<LotDataTransmission>(LotDataTransmission.Cleared, simulator.LotDataTransmission);
            Assert.AreEqual<int>(lotData.Wafers.Count, simulator.WaferQuantity);
            Assert.AreEqual<int>(lotData.NGWaferCount, simulator.NotGoodWaferQuantity);
            Assert.AreEqual<WaferSize>(lotData.WaferSize, simulator.Size);
            Assert.AreEqual<OfType>(lotData.OfType, simulator.Type);
            Assert.AreEqual<PolishDivision>(lotData.PolishDivision, simulator.Division);
            Assert.AreEqual<int>(lotData.Assembly1.CarrierPlateCount, simulator.CarrierPlateQuantity1);
            Assert.AreEqual<int>(lotData.Assembly1.WaferCount, simulator.WaferQuantity1);
            Assert.AreEqual<int>(lotData.Assembly2.CarrierPlateCount, simulator.CarrierPlateQuantity2);
            Assert.AreEqual<int>(lotData.Assembly2.WaferCount, simulator.WaferQuantity2);

            for (int idx = 0; idx < lotData.Wafers.Count; idx++)
            {
                Assert.AreEqual<int>(lotData.Wafers[idx].CassetteNumber, simulator.Wafers[idx].WaferCassetteNumber);
                Assert.AreEqual<int>(lotData.Wafers[idx].SlotNumber, simulator.Wafers[idx].WaferSlotNumber);
            }
            // Check lot data - END
        }
 private void ChangeStatusData(MountSimulatorPlcCommunication simulator)
 {
     for (int i = 0; i < _random.Next(1, 7); i++)
     {
         switch (_random.Next(1, 7))
         {
             case 1:
                 simulator.CassetteId = SimulatorHelper.GetRandomString(8);
                 break;
             case 2:
                 simulator.IsCassetteId = (_random.NextDouble() > 0.5) ? true : false;
                 break;
             case 3:
                 simulator.IsLotDataTimeout = (_random.NextDouble() > 0.5) ? true : false;
                 break;
             case 4:
                 simulator.IsCarrierPlateArrived = (_random.NextDouble() > 0.5) ? true : false;
                 break;
             case 5:
                 simulator.WaferBreakNumber = SimulatorHelper.GetRandomUshort();
                 break;
             case 6:
                 simulator.State = SimulatorHelper.GetRandomMountState();
                 break;
         }
     }
 }