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

            return(this.Builder);
        }
        /// <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);
        }
Beispiel #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());
        }
Beispiel #4
0
        /// <inheritdoc />
        public IBaseTestBuilderWithViewComponent NoAttributes()
        {
            AttributesValidator.ValidateNoAttributes(
                this.ViewComponentAttributes,
                this.ThrowNewAttributeAssertionException);

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

            return(this.Builder);
        }
Beispiel #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");
        }
Beispiel #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());
        }