public void TestDescribedAsAnnotationPickedUpOnActionParameter()
        {
            MethodInfo actionMethod = FindMethod(typeof(Customer4), "SomeAction", new[] { typeof(int) });

            facetFactory.ProcessParams(Reflector, actionMethod, 0, Specification);
            IFacet facet = Specification.GetFacet(typeof(IDescribedAsFacet));

            Assert.IsNotNull(facet);
            Assert.IsTrue(facet is DescribedAsFacetAbstract);
            var describedAsFacetAbstract = (DescribedAsFacetAbstract)facet;

            Assert.AreEqual("some description", describedAsFacetAbstract.Value);
        }
Esempio n. 2
0
        public void TestDescribedAsAnnotationPickedUpOnActionParameter()
        {
            IImmutableDictionary <string, ITypeSpecBuilder> metamodel = new Dictionary <string, ITypeSpecBuilder>().ToImmutableDictionary();

            MethodInfo actionMethod = FindMethod(typeof(Customer4), "SomeAction", new[] { typeof(int) });

            metamodel = facetFactory.ProcessParams(Reflector, actionMethod, 0, Specification, metamodel);
            IFacet facet = Specification.GetFacet(typeof(IDescribedAsFacet));

            Assert.IsNotNull(facet);
            Assert.IsTrue(facet is DescribedAsFacetAbstract);
            var describedAsFacetAbstract = (DescribedAsFacetAbstract)facet;

            Assert.AreEqual("some description", describedAsFacetAbstract.Value);
            Assert.IsNotNull(metamodel);
        }