Ejemplo n.º 1
0
        public static bool TryParse(string value, out MailboxName mailboxName, out IReadOnlyCollection <string> errorMessages)
        {
            var errorMessageList = new List <string>();

            errorMessages = errorMessageList;

            if (IsEmpty(value))
            {
                // TryParse should never fail, so report null as an error instead of ArgumentNullException.
                errorMessageList.Add("Value required");
            }
            else
            {
                if (!Pattern.IsMatch(value))
                {
                    errorMessageList.Add("Must match the pattern 'wd_1234567890123'");
                }
            }

            if (errorMessageList.Count > 0)
            {
                mailboxName = null;
                return(false);
            }

            mailboxName = new MailboxName
            {
                Value = value
            };

            return(true);
        }
Ejemplo n.º 2
0
        protected bool Equals(MailboxName other)
        {
            if (!object.Equals(this.Value, other.Value))
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 3
0
        public TryGetLatestMessageQuery(
            Fifthweek.Api.EndToEndTestMailboxes.Shared.MailboxName mailboxName)
        {
            if (mailboxName == null)
            {
                throw new ArgumentNullException("mailboxName");
            }

            this.MailboxName = mailboxName;
        }
Ejemplo n.º 4
0
        public DeleteAllMessagesCommand(
            Fifthweek.Api.EndToEndTestMailboxes.Shared.MailboxName mailboxName)
        {
            if (mailboxName == null)
            {
                throw new ArgumentNullException("mailboxName");
            }

            this.MailboxName = mailboxName;
        }
Ejemplo n.º 5
0
        public static bool TryParse(string value, out MailboxName mailboxName)
        {
            IReadOnlyCollection <string> errorMessages;

            return(TryParse(value, out mailboxName, out errorMessages));
        }