示例#1
0
        /// <inheritdoc />
        public IBaseTestBuilderWithViewComponentResult <TInvocationResult> HtmlContent(Func <string, bool> predicate)
        {
            var actualContent = this.GetHtmlContentAsString();

            if (!predicate(actualContent))
            {
                throw ContentViewComponentResultAssertionException.ForPredicate(
                          this.TestContext.ExceptionMessagePrefix,
                          actualContent);
            }

            return(this.NewAndTestBuilderWithViewComponentResult());
        }
        /// <inheritdoc />
        public IAndTestBuilder Content(Func <string, bool> predicate)
        {
            var actualContent = this.GetActualContent();

            if (!predicate(actualContent))
            {
                throw ContentViewComponentResultAssertionException.ForPredicate(
                          this.TestContext.ExceptionMessagePrefix,
                          actualContent);
            }

            return(new AndTestBuilder(this.TestContext));
        }
示例#3
0
        /// <inheritdoc />
        public IBaseTestBuilderWithViewComponentResult <TInvocationResult> HtmlContent(string htmlContent)
        {
            var actualContent = this.GetHtmlContentAsString();

            if (htmlContent != actualContent)
            {
                throw ContentViewComponentResultAssertionException.ForEquality(
                          this.TestContext.ExceptionMessagePrefix,
                          htmlContent,
                          actualContent);
            }

            return(this.NewAndTestBuilderWithViewComponentResult());
        }
示例#4
0
        /// <inheritdoc />
        public IAndTestBuilder HtmlContent(string htmlContent)
        {
            var actualContent = this.GetHtmlContentAsString();

            if (htmlContent != actualContent)
            {
                throw ContentViewComponentResultAssertionException.ForEquality(
                          this.TestContext.ExceptionMessagePrefix,
                          htmlContent,
                          actualContent);
            }

            return(new AndTestBuilder(this.TestContext));
        }