Ejemplo n.º 1
0
        /// <summary>
        /// Gets Values
        /// </summary>
        /// <param name="arrange">arrange parameter</param>
        /// <param name="assertionItem">assertionItem parameter</param>
        /// <returns>value from arrange</returns>
        protected override IEnumerable<string> GetValues(Arrange arrange, ContentAssertionItem assertionItem)
        {
            var values = base.GetValues(arrange, assertionItem);

            var list = new List<string>();
            foreach (var value in values)
            {
                list.Add(GetDateTimeString(value, assertionItem.Format, assertionItem.FormatCulture));
            }

            return list;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets Values
        /// </summary>
        /// <param name="arrange">arrange parameter</param>
        /// <param name="assertionItem">assertionItem parameter</param>
        /// <returns>value from arrange</returns>
        protected override IEnumerable <string> GetValues(Arrange arrange, ContentAssertionItem assertionItem)
        {
            var values = base.GetValues(arrange, assertionItem);

            var list = new List <string>();

            foreach (var value in values)
            {
                list.Add(GetDateTimeString(value, assertionItem.Format, assertionItem.FormatCulture));
            }

            return(list);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets Value
        /// </summary>
        /// <param name="arrange">arrange parameter</param>
        /// <param name="assertionItem">assertionItem parameter</param>
        /// <returns>value from arrange</returns>
        protected virtual string GetValue(Arrange arrange, ContentAssertionItem assertionItem)
        {
            if (assertionItem.Value != null)
            {
                return(assertionItem.Value);
            }

            var value = arrange.HttpResponse.GetDocumentValue(assertionItem.Query, assertionItem.Attribute);

            if (assertionItem.Pattern != null)
            {
                return(TextAssertion.Match(value, assertionItem.Pattern));
            }

            return(value);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Gets Values
        /// </summary>
        /// <param name="arrange">arrange parameter</param>
        /// <param name="assertionItem">assertionItem parameter</param>
        /// <returns>value from arrange</returns>
        protected virtual IEnumerable <string> GetValues(Arrange arrange, ContentAssertionItem assertionItem)
        {
            if (assertionItem.Value != null)
            {
                throw new NotImplementedException("Static value test for list is not supported.");
            }

            var values = arrange.HttpResponse.GetDocumentValues(assertionItem.Query, assertionItem.Attribute);

            if (assertionItem.Pattern != null)
            {
                var list = new List <string>();
                foreach (var value in values)
                {
                    list.Add(Match(value, assertionItem.Pattern));
                }

                return(list);
            }

            return(values);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Gets Values
        /// </summary>
        /// <param name="arrange">arrange parameter</param>
        /// <param name="assertionItem">assertionItem parameter</param>
        /// <returns>value from arrange</returns>
        protected virtual IEnumerable<string> GetValues(Arrange arrange, ContentAssertionItem assertionItem)
        {
            if (assertionItem.Value != null)
            {
                throw new NotImplementedException("Static value test for list is not supported.");
            }

            var values = arrange.HttpResponse.GetDocumentValues(assertionItem.Query, assertionItem.Attribute);

            if (assertionItem.Pattern != null)
            {
                var list = new List<string>();
                foreach (var value in values)
                {
                    list.Add(Match(value, assertionItem.Pattern));
                }

                return list;
            }

            return values;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Gets Value
        /// </summary>
        /// <param name="arrange">arrange parameter</param>
        /// <param name="assertionItem">assertionItem parameter</param>
        /// <returns>value from arrange</returns>
        protected virtual string GetValue(Arrange arrange, ContentAssertionItem assertionItem)
        {
            if (assertionItem.Value != null)
            {
                return assertionItem.Value;
            }

            var value = arrange.HttpResponse.GetDocumentValue(assertionItem.Query, assertionItem.Attribute);
            if (assertionItem.Pattern != null)
            {
                return TextAssertion.Match(value, assertionItem.Pattern);
            }

            return value;
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Gets Value
 /// </summary>
 /// <param name="arrange">arrange parameter</param>
 /// <param name="assertionItem">assertionItem parameter</param>
 /// <returns>value from arrange</returns>
 protected override string GetValue(Arrange arrange, ContentAssertionItem assertionItem)
 {
     var value = base.GetValue(arrange, assertionItem);
     return GetDateTimeString(value, assertionItem.Format, assertionItem.FormatCulture);
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Gets Value
        /// </summary>
        /// <param name="arrange">arrange parameter</param>
        /// <param name="assertionItem">assertionItem parameter</param>
        /// <returns>value from arrange</returns>
        protected override string GetValue(Arrange arrange, ContentAssertionItem assertionItem)
        {
            var value = base.GetValue(arrange, assertionItem);

            return(GetDateTimeString(value, assertionItem.Format, assertionItem.FormatCulture));
        }