Example #1
0
        public void NoDecoratedProperties()
        {
            MockBuilderContext         context  = new MockBuilderContext();
            PropertyReflectionStrategy strategy = new PropertyReflectionStrategy();

            strategy.BuildUp(context, typeof(object), null);

            IPropertySetterPolicy policy = context.Policies.Get <IPropertySetterPolicy>(typeof(object));

            Assert.Null(policy);
        }
Example #2
0
        public void DecoratedProperty()
        {
            MockBuilderContext         context  = new MockBuilderContext();
            PropertyReflectionStrategy strategy = new PropertyReflectionStrategy();

            strategy.BuildUp(context, typeof(Decorated), null);

            IPropertySetterPolicy policy = context.Policies.Get <IPropertySetterPolicy>(typeof(Decorated));

            Assert.NotNull(policy);
            Assert.NotEmpty(policy.Properties);
            foreach (ReflectionPropertySetterInfo property in policy.Properties)
            {
                Assert.Equal(typeof(Decorated).GetProperty("Property"), property.Property);
            }
        }