public void Returns_false_and_no_LotStat_will_have_been_set_it_no_unresolved_InHouseContamination_defects_exist() { //Arrange var lotWithNoDefects = new Lot { LotDefects = new LotDefect[0] }; var lotWithResolvedDefects = new Lot { LotDefects = new[] { BuildLotDefect(DefectTypeEnum.InHouseContamination, true), BuildLotDefect(DefectTypeEnum.InHouseContamination, true) } }; var oldLot = new tblLot { LotStat = null }; //Act-Assert Assert.IsFalse(LotSyncHelper.SetInHouseContamination(oldLot, lotWithNoDefects)); Assert.IsNull(oldLot.LotStat); Assert.IsFalse(LotSyncHelper.SetInHouseContamination(oldLot, lotWithResolvedDefects)); Assert.IsNull(oldLot.LotStat); }
private static void TestInHouseContamination(LotStat expected, string description) { tblLot oldLot; Lot newLot; ArrangeLots(description, out oldLot, out newLot); Assert.IsTrue(LotSyncHelper.SetInHouseContamination(oldLot, newLot)); Assert.AreEqual((int)expected, oldLot.LotStat); }
public void Returns_true_and_LotStat_will_have_been_set_with_Notes_as_expected_for_an_unmatched_description() { tblLot oldLot; Lot newLot; const string description = "dark hard stuff with soft smoke"; ArrangeLots(description, out oldLot, out newLot); Assert.IsTrue(LotSyncHelper.SetInHouseContamination(oldLot, newLot)); Assert.AreEqual((int)LotStat.See_Desc, oldLot.LotStat); Assert.AreEqual(description, oldLot.Notes); }