public void TestDescribedAsAnnotationPickedUpOnAction()
        {
            MethodInfo actionMethod = FindMethod(typeof(Customer3), "SomeAction");

            facetFactory.Process(Reflector, actionMethod, MethodRemover, 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);
            AssertNoMethodsRemoved();
        }
Esempio n. 2
0
        public void TestDescribedAsAnnotationPickedUpOnAction()
        {
            IImmutableDictionary <string, ITypeSpecBuilder> metamodel = new Dictionary <string, ITypeSpecBuilder>().ToImmutableDictionary();

            MethodInfo actionMethod = FindMethod(typeof(Customer3), "SomeAction");

            metamodel = facetFactory.Process(Reflector, actionMethod, MethodRemover, 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);
            AssertNoMethodsRemoved();
            Assert.IsNotNull(metamodel);
        }