public void AddMessage(string message, ScheduleMessageState type = ScheduleMessageState.Info)
 {
     if(String.IsNullOrEmpty(message)) throw new InvalidOperationException("Message can not be empty");
     if (type > currentMessagesState) currentMessagesState = type;
     var assertionMessage = new ScriptAssertionMessage()
                                      {
                                          Date = DateTime.Now,
                                          Message = message,
                                          Type = type
                                      };
     messages.Add(assertionMessage);
     if (OnNewMessage != null) OnNewMessage(assertionMessage);
 }
        public void AddMessage(string message, ScheduleMessageState type = ScheduleMessageState.Info)
        {
            if (String.IsNullOrEmpty(message))
            {
                throw new InvalidOperationException("Message can not be empty");
            }
            if (type > currentMessagesState)
            {
                currentMessagesState = type;
            }
            var assertionMessage = new ScriptAssertionMessage()
            {
                Date    = DateTime.Now,
                Message = message,
                Type    = type
            };

            messages.Add(assertionMessage);
            if (OnNewMessage != null)
            {
                OnNewMessage(assertionMessage);
            }
        }