示例#1
0
        public void TestGetAllLogDateError()
        {
            List <CommandType> lst = new List <CommandType>();
            string             str;
            ResultCodeEnum     res = HistoryLogger.GetAllLog(lst, DateTime.UtcNow, DateTime.UtcNow, 0, out str);

            Assert.AreNotEqual(ResultCodeEnum.InvalidCommandType, res);
        }
示例#2
0
        public void TestGetAllLog()
        {
            List <CommandType> lst = new List <CommandType>();

            lst.Add(CommandType.SendScheduledMessage);
            string         str;
            ResultCodeEnum res = HistoryLogger.GetAllLog(lst, DateTime.Now, DateTime.Now, 0, out str);

            Assert.AreEqual(ResultCodeEnum.RequestAccepted, res);
        }
示例#3
0
 /// <summary>
 /// Method used to get all the log message
 /// </summary>
 /// <param name="commandList">command list</param>
 /// <param name="startDateTime">start date time to be considered</param>
 /// <param name="endDateTime">end date time to be considered</param>
 /// <param name="language">language code</param>
 /// <param name="logResponse">output log response</param>
 /// <returns>Error code if any</returns>
 public static ResultCodeEnum GetAllLog(List <PIS.Ground.Core.Data.CommandType> commandList, DateTime startDateTime, DateTime endDateTime, uint language, out string logResponse)
 {
     logResponse = string.Empty;
     if (HistoryLoggerConfiguration.Used)
     {
         return(HistoryLogger.GetAllLog(commandList, startDateTime, endDateTime, language, out logResponse));
     }
     else
     {
         return(ResultCodeEnum.RequestAccepted);
     }
 }
示例#4
0
        public void TestGetAllLogMultiCommand()
        {
            Guid id = Guid.NewGuid();
            List <CommandType> lst = new List <CommandType>();

            lst.Add(CommandType.SendScheduledMessage);
            lst.Add(CommandType.CancelScheduledMessage);
            string         str;
            ResultCodeEnum res = HistoryLogger.GetAllLog(lst, DateTime.Parse("2012-06-26"), DateTime.Parse("2012-06-28"), 0, out str);

            Assert.AreEqual(ResultCodeEnum.RequestAccepted, res);
        }
示例#5
0
        public void TestMaxCountTest()
        {
            for (int i = 0; i < 100; i++)
            {
                Guid id = Guid.NewGuid();
                HistoryLogger.WriteLog("TestWritelog", id, CommandType.SendScheduledMessage, "TRAIN" + i.ToString(), MessageStatusType.InstantMessageDistributionProcessing, DateTime.Now, DateTime.Now);
            }
            List <CommandType> lst = new List <CommandType>();

            lst.Add(CommandType.CancelScheduledMessage);
            lst.Add(CommandType.SendScheduledMessage);
            string         str;
            ResultCodeEnum res = HistoryLogger.GetAllLog(lst, DateTime.Parse("2012-06-26"), DateTime.Parse("2012-06-29"), 0, out str);

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