private void CheckAutoCompleteFacetIsNull(MethodInfo autoCompleteMethod, IActionParameterSpecImmutable parameter)
        {
            var facet = parameter.GetFacet(typeof(IAutoCompleteFacet));

            Assert.IsNull(facet);

            AssertMethodNotRemoved(autoCompleteMethod);
        }
        private void CheckChoicesFacet(MethodInfo choicesMethod, IActionParameterSpecImmutable parameter)
        {
            var facet = parameter.GetFacet(typeof(IActionChoicesFacet));

            Assert.IsNotNull(facet);
            Assert.IsTrue(facet is ActionChoicesFacetViaMethod);
            Assert.AreEqual(choicesMethod, ((ActionChoicesFacetViaMethod)facet).GetMethod());

            AssertMethodRemoved(choicesMethod);
        }
        private void CheckValidatePrameterFacet(MethodInfo method, IActionParameterSpecImmutable parameter)
        {
            var facet = parameter.GetFacet(typeof(IActionParameterValidationFacet));

            Assert.IsNotNull(facet);
            Assert.IsTrue(facet is ActionParameterValidation);
            Assert.AreEqual(method, ((ActionParameterValidation)facet).GetMethod());

            AssertMethodRemoved(method);
        }
        private void CheckDefaultFacet(MethodInfo defaultMethod, IActionParameterSpecImmutable parameter)
        {
            var facet = parameter.GetFacet(typeof(IActionDefaultsFacet));

            Assert.IsNotNull(facet);
            Assert.IsTrue(facet is ActionDefaultsFacetViaMethod);
            Assert.AreEqual(defaultMethod, ((ActionDefaultsFacetViaMethod)facet).GetMethod());
            Assert.IsNotNull(((ActionDefaultsFacetViaMethod)facet).MethodDelegate);

            AssertMethodRemoved(defaultMethod);
        }
        private void CheckAutoCompleteFacet(MethodInfo autoCompleteMethod, IActionParameterSpecImmutable parameter, int pageSize, int minLength)
        {
            var facet = parameter.GetFacet(typeof(IAutoCompleteFacet));

            Assert.IsNotNull(facet);
            Assert.IsTrue(facet is AutoCompleteFacet);
            var acf = (AutoCompleteFacet)facet;

            Assert.AreEqual(autoCompleteMethod, acf.GetMethod());

            AssertMethodRemoved(autoCompleteMethod);

            Assert.AreEqual(pageSize, acf.PageSize);
            Assert.AreEqual(minLength, acf.MinLength);
        }
Example #6
0
 public virtual IFacet GetFacet(Type type)
 {
     return(actionParameterSpecImmutable.GetFacet(type));
 }