Ejemplo n.º 1
0
        /// <summary>Gets an error message for an invalid element.</summary>
        /// <param name="element">The invalid element. </param>
        /// <returns>The error message. </returns>
        public string GetErrorMessage(BaseHtmlElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            return("Expected tag not in set of input, textarea, select, button, option. But was '{0}'.".F(element.TagName));
        }
Ejemplo n.º 2
0
        /// <summary>Gets an error message for an invalid element.</summary>
        /// <param name="element">The invalid element. </param>
        /// <returns>The error message. </returns>
        public string GetErrorMessage(BaseHtmlElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            return "Expected tag not in set of input, textarea, select, button, option. But was '{0}'.".F(element.TagName);
        }
Ejemplo n.º 3
0
        /// <summary>Gets an error message for an invalid element.</summary>
        /// <param name="element">The invalid element.</param>
        /// <returns>The error message.</returns>
        public string GetErrorMessage(BaseHtmlElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            return("'{0}' tag does not match to '{1}' tag".F(element.TagName, this.tagName));
        }
Ejemplo n.º 4
0
        /// <summary>Gets an error message for an invalid element.</summary>
        /// <param name="element">The invalid element.</param>
        /// <returns>The error message.</returns>
        public string GetErrorMessage(BaseHtmlElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            return "'{0}' tag does not match to '{1}' tag".F(element.TagName, this.tagName);
        }
Ejemplo n.º 5
0
        /// <summary>Validates an element.</summary>
        /// <param name="element">The element.</param>
        /// <returns>True if element is valid otherwise false.</returns>
        public bool Validate(BaseHtmlElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            return(string.Equals(element.TagName, this.tagName, StringComparison.InvariantCultureIgnoreCase));
        }
Ejemplo n.º 6
0
        /// <summary>Validates an element.</summary>
        /// <param name="element">The element.</param>
        /// <returns>True if element is valid otherwise false.</returns>
        public bool Validate(BaseHtmlElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            return string.Equals(element.TagName, this.tagName, StringComparison.InvariantCultureIgnoreCase);
        }
Ejemplo n.º 7
0
        /// <summary>Validates an element.</summary>
        /// <param name="element">The element.</param>
        /// <returns>True if element is valid otherwise false.</returns>
        public bool Validate(BaseHtmlElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            return(string.Equals(element.TagName, HtmlElements.Input, StringComparison.InvariantCultureIgnoreCase) &&
                   string.Equals(element.GetAttributeValue(HtmlElementAttributes.Type), this.typeName, StringComparison.InvariantCultureIgnoreCase));
        }
Ejemplo n.º 8
0
        /// <summary>Validates an element.</summary>
        /// <param name="element">The element.</param>
        /// <returns>True if element is valid otherwise false.</returns>
        public bool Validate(BaseHtmlElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            return string.Equals(element.TagName, HtmlElements.Input, StringComparison.InvariantCultureIgnoreCase)
                   && string.Equals(element.GetAttributeValue(HtmlElementAttributes.Type), this.typeName, StringComparison.InvariantCultureIgnoreCase);
        }
Ejemplo n.º 9
0
        /// <summary>Gets an error message for an invalid element.</summary>
        /// <param name="element">The invalid element.</param>
        /// <returns>The error message.</returns>
        public string GetErrorMessage(BaseHtmlElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            return(string.Equals(element.TagName, HtmlElements.Input, StringComparison.InvariantCultureIgnoreCase)
                       ? @"The attribute 'type=""{0}""' does not match to 'type=""{1}""'".F(element.GetAttributeValue(HtmlElementAttributes.Type), this.typeName)
                       : "'{0}' tag does not match to '{1}' tag".F(element.TagName, HtmlElements.Input));
        }
Ejemplo n.º 10
0
        /// <summary>Gets an error message for an invalid element.</summary>
        /// <param name="element">The invalid element.</param>
        /// <returns>The error message.</returns>
        public string GetErrorMessage(BaseHtmlElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            return string.Equals(element.TagName, HtmlElements.Input, StringComparison.InvariantCultureIgnoreCase)
                       ? @"The attribute 'type=""{0}""' does not match to 'type=""{1}""'".F(element.GetAttributeValue(HtmlElementAttributes.Type), this.typeName)
                       : "'{0}' tag does not match to '{1}' tag".F(element.TagName, HtmlElements.Input);
        }
Ejemplo n.º 11
0
        /// <summary>Validates an element.</summary>
        /// <param name="element">The element. </param>
        /// <returns>True if element is valid otherwise false. </returns>
        public bool Validate(BaseHtmlElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            var tagName = element.TagName;
            return !string.Equals(tagName, HtmlElements.Input, StringComparison.InvariantCultureIgnoreCase)
                   && !string.Equals(tagName, HtmlElements.Button, StringComparison.InvariantCultureIgnoreCase)
                   && !string.Equals(tagName, HtmlElements.Option, StringComparison.InvariantCultureIgnoreCase)
                   && !string.Equals(tagName, HtmlElements.Select, StringComparison.InvariantCultureIgnoreCase)
                   && !string.Equals(tagName, HtmlElements.TextArea, StringComparison.InvariantCultureIgnoreCase);
        }
Ejemplo n.º 12
0
        /// <summary>Validates an element.</summary>
        /// <param name="element">The element. </param>
        /// <returns>True if element is valid otherwise false. </returns>
        public bool Validate(BaseHtmlElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            var tagName = element.TagName;

            return(!string.Equals(tagName, HtmlElements.Input, StringComparison.InvariantCultureIgnoreCase) &&
                   !string.Equals(tagName, HtmlElements.Button, StringComparison.InvariantCultureIgnoreCase) &&
                   !string.Equals(tagName, HtmlElements.Option, StringComparison.InvariantCultureIgnoreCase) &&
                   !string.Equals(tagName, HtmlElements.Select, StringComparison.InvariantCultureIgnoreCase) &&
                   !string.Equals(tagName, HtmlElements.TextArea, StringComparison.InvariantCultureIgnoreCase));
        }
 public string GetErrorMessage(BaseHtmlElement element)
 {
     throw new NotSupportedException();
 }
Ejemplo n.º 14
0
 public void WhenIgoToAPreviousSiblingOfTheElement()
 {
     this.element = this.element.PreviousSibling;
 }
Ejemplo n.º 15
0
 public void WhenIgoToANextSiblingOfTheElement()
 {
     this.element = this.element.NextSibling;
 }
 public string GetErrorMessage(BaseHtmlElement element)
 {
     throw new NotSupportedException();
 }
 public bool Validate(BaseHtmlElement element)
 {
     return true;
 }
Ejemplo n.º 18
0
 public void WhenILookAtAnElementWithId(string id)
 {
     this.element = Browser.Current.Container(By.Id(id));
 }
Ejemplo n.º 19
0
 public void WhenIgoToAParentOfTheElement()
 {
     this.element = this.element.Parent;
 }
Ejemplo n.º 20
0
 public void WhenIgoToAParentOfTheElement()
 {
     this.element = this.element.Parent;
 }
Ejemplo n.º 21
0
 public void WhenIgoToAPreviousSiblingOfTheElement()
 {
     this.element = this.element.PreviousSibling;
 }
Ejemplo n.º 22
0
 public void WhenIgoToANextSiblingOfTheElement()
 {
     this.element = this.element.NextSibling;
 }
 public bool Validate(BaseHtmlElement element)
 {
     return(true);
 }
Ejemplo n.º 24
0
 public void WhenILookAtAnElementWithId(string id)
 {
     this.element = Browser.Current.Container(By.Id(id));
 }