public void RejectionCorrectlyConstructsFromInputData() { var rej = new Rejection("Code", "desc", "rsn", (int)RejectionState.FOREVER); Assert.AreEqual("Code", rej.Code); Assert.AreEqual("desc", rej.Desc); Assert.AreEqual("rsn", rej.Reason); Assert.AreEqual(RejectionState.FOREVER, rej.Type); Assert.AreEqual("Codedesc".GetHashCode(), rej.GetHashCode()); Assert.AreEqual("Code - desc", rej.ToString()); Assert.IsTrue(rej.Equals(rej)); Assert.IsTrue(rej.Equals(new Rejection("Code", "desc", "a", 0))); Assert.IsFalse(rej.Equals(this)); Assert.IsFalse(rej.Equals(new Rejection("code", "desc", "2", 0))); Assert.IsFalse(rej.Equals(new Rejection("Code", "Desc", "2", 0))); }
/// <summary> /// Rejection Arrived in OEE /// </summary> /// <param name="obj"></param> private void NewRejectionArrived(Rejection obj) { try { if (Logger.IsInfoEnabled) { Logger.Info(obj.ToString(), _type.FullName, "NewRejectionArrived"); } if (OrderRejectionArrived != null) { OrderRejectionArrived.Invoke(obj); } } catch (Exception exception) { Logger.Error(exception, _type.FullName, "NewRejectionArrived"); } }