示例#1
0
        /// <inheritdoc />
        public IAndActionResultTestBuilder <TActionResult> NoActionAttributes()
        {
            AttributesValidator.ValidateNoAttributes(
                this.TestContext.MethodAttributes,
                this.ThrowNewAttributeAssertionException);

            return(this.Builder);
        }
示例#2
0
        /// <summary>
        /// Checks whether the tested controller has no attributes of any type.
        /// </summary>
        /// <returns>Base test builder.</returns>
        public IBaseTestBuilder NoAttributes()
        {
            AttributesValidator.ValidateNoAttributes(
                this.ControllerLevelAttributes,
                this.ThrowNewAttributeAssertionException);

            return(this);
        }
示例#3
0
        /// <summary>
        /// Checks whether the tested action has no attributes of any type.
        /// </summary>
        /// <returns>Test builder with AndAlso method.</returns>
        public IAndTestBuilder <TActionResult> NoActionAttributes()
        {
            AttributesValidator.ValidateNoAttributes(
                this.ActionLevelAttributes,
                this.ThrowNewAttributeAssertionException);

            return(this.NewAndTestBuilder());
        }
示例#4
0
        /// <inheritdoc />
        public IBaseTestBuilderWithViewComponent NoAttributes()
        {
            AttributesValidator.ValidateNoAttributes(
                this.ViewComponentAttributes,
                this.ThrowNewAttributeAssertionException);

            return(this);
        }
示例#5
0
        /// <inheritdoc />
        public IAndViewComponentResultTestBuilder <TInvocationResult> NoAttributes()
        {
            AttributesValidator.ValidateNoAttributes(
                this.TestContext.ComponentAttributes,
                this.ThrowNewAttributeAssertionException);

            return(this.Builder);
        }
示例#6
0
        public void ValidateNoAttributesShouldFailWithAttributes()
        {
            var attributes = Reflection.GetCustomAttributes(new MvcController());

            Test.AssertException <NullReferenceException>(
                () =>
            {
                AttributesValidator.ValidateNoAttributes(attributes, TestObjectFactory.GetFailingValidationActionWithTwoParameteres());
            },
                "not have any attributes it had some");
        }
示例#7
0
        public void ValidateNoAttributesShouldNotFailWithNoAttributes()
        {
            var attributes = Reflection.GetCustomAttributes(new ClaimsPrincipalBuilder());

            AttributesValidator.ValidateNoAttributes(attributes, TestObjectFactory.GetFailingValidationActionWithTwoParameteres());
        }
        public void ValidateNoAttributesShouldFailWithAttributes()
        {
            var attributes = Reflection.GetCustomAttributes(new WebApiController());

            AttributesValidator.ValidateNoAttributes(attributes, TestObjectFactory.GetFailingValidationActionWithTwoParameteres());
        }