Ejemplo n.º 1
0
        public void TestCancelLogTrainError()
        {
            Guid           id  = Guid.NewGuid();
            ResultCodeEnum res = HistoryLogger.CancelLog(id, CommandType.CancelScheduledMessage, "", MessageStatusType.InstantMessageDistributionProcessing);

            Assert.AreNotEqual(ResultCodeEnum.RequestAccepted, res);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Method used to cancel history log details.
 /// </summary>
 /// <param name="requestId">request id of the message</param>
 /// <param name="commandType">command type</param>
 /// <param name="trainId">list of train ids</param>
 /// <returns>Error code if any</returns>
 public static ResultCodeEnum CancelLog(Guid requestId, PIS.Ground.Core.Data.CommandType commandType, string trainId, MessageStatusType messageStatus)
 {
     if (HistoryLoggerConfiguration.Used)
     {
         return(HistoryLogger.CancelLog(requestId, commandType, trainId, messageStatus));
     }
     else
     {
         return(ResultCodeEnum.RequestAccepted);
     }
 }
Ejemplo n.º 3
0
        public void TestCancelLog()
        {
            Guid id = Guid.NewGuid();

            HistoryLogger.WriteLog("TestWritelog", id, CommandType.SendScheduledMessage, "TRAIN1", MessageStatusType.InstantMessageDistributionProcessing, DateTime.Now, DateTime.Now);
            HistoryLogger.WriteLog("TestWritelog", id, CommandType.SendScheduledMessage, "TRAIN2", MessageStatusType.InstantMessageDistributionProcessing, DateTime.Now, DateTime.Now);
            HistoryLogger.WriteLog("TestWritelog", id, CommandType.SendScheduledMessage, "TRAIN3", MessageStatusType.InstantMessageDistributionProcessing, DateTime.Now, DateTime.Now);
            HistoryLogger.WriteLog("TestWritelog", id, CommandType.SendScheduledMessage, "TRAIN4", MessageStatusType.InstantMessageDistributionProcessing, DateTime.Now, DateTime.Now);

            ResultCodeEnum res = HistoryLogger.CancelLog(id, CommandType.CancelScheduledMessage, "TRAIN1", MessageStatusType.InstantMessageDistributionProcessing);

            Assert.AreEqual(ResultCodeEnum.RequestAccepted, res);
        }