Exemple #1
0
 public void Returns_false_if_ChileLot_is_missing_any_LotAttribute_for_a_ChileProductRange()
 {
     Assert.IsFalse(LotStatusHelper.ChileLotAllProductSpecsEntered(new ChileLot
     {
         Lot = new Lot
         {
             Attributes = BuildLotAttributes(StaticAttributeNames.Asta, StaticAttributeNames.Scoville)
         },
         ChileProduct = new ChileProduct
         {
             ProductAttributeRanges = BuildAttributeRanges(StaticAttributeNames.Asta, StaticAttributeNames.Scan, StaticAttributeNames.Scoville)
         }
     }));
 }
Exemple #2
0
 public void Returns_true_if_ChileLot_contains_LotAttributes_for_all_ChileProductAttributeRanges()
 {
     Assert.IsTrue(LotStatusHelper.ChileLotAllProductSpecsEntered(new ChileLot
     {
         Lot = new Lot
         {
             Attributes = BuildLotAttributes(StaticAttributeNames.Asta, StaticAttributeNames.Scan, StaticAttributeNames.Scoville)
         },
         ChileProduct = new ChileProduct
         {
             ProductAttributeRanges = BuildAttributeRanges(StaticAttributeNames.Asta, StaticAttributeNames.Scan, StaticAttributeNames.Scoville)
         }
     }));
 }
            private bool SetLotStatuses(LotDTO oldLot, ChileLot newChileLot, IEnumerable <AttributeName> attributeNames, ref List <LotAttributeDefect> attributeDefects)
            {
                newChileLot.AllAttributesAreLoBac = LotStatusHelper.DetermineChileLotIsLoBac(newChileLot, attributeNames);
                newChileLot.Lot.ProductionStatus  = oldLot._BatchStatID < 3 ? LotProductionStatus.Batched : LotProductionStatus.Produced;
                LotMother.SetLotHoldStatus(oldLot.LotStat, newChileLot.Lot);
                newChileLot.Lot.ProductSpecComplete   = LotStatusHelper.ChileLotAllProductSpecsEntered(newChileLot);
                newChileLot.Lot.ProductSpecOutOfRange = LotStatusHelper.ChileLotAttributeOutOfRange(newChileLot);

                if (!SetLotQualityStatus(oldLot.LotStat, newChileLot.Lot, ref attributeDefects))
                {
                    LotMother.Log(new CallbackParameters(oldLot, CallbackReason.ChileLotStatusConflict)
                    {
                        ChileLot = newChileLot
                    });
                    return(false);
                }

                return(true);
            }