public void CreatePropertyBag_ClassWithInternalFields_PropertiesAreGenerated()
        {
            var propertyBag = new ReflectedPropertyBagProvider().CreatePropertyBag <ClassWithInternalFields>();

            Assert.That(propertyBag, Is.Not.Null);

            Assert.That(propertyBag.HasProperty(ClassWithInternalFields.IntPropertyName), Is.False);
            Assert.That(propertyBag.HasProperty(ClassWithInternalFields.FloatPropertyName), Is.True);
            Assert.That(propertyBag.HasProperty(ClassWithInternalFields.MaskedPropertyName), Is.True);
            Assert.That(propertyBag.HasProperty(DerivedClassWithInternalFields.BoolPropertyName), Is.False);
            Assert.That(propertyBag.HasProperty(DerivedClassWithInternalFields.StringPropertyName), Is.False);

            var container = new ClassWithInternalFields();

            Assert.That(propertyBag.GetPropertyValue(ref container, ClassWithInternalFields.FloatPropertyName), Is.EqualTo(123.456f));
            Assert.That(propertyBag.GetPropertyValue(ref container, ClassWithInternalFields.MaskedPropertyName), Is.EqualTo(1));
        }
        public void CreatePropertyBag_DerivedClassWithPrivateProperties_PropertiesAreGenerated()
        {
            var propertyBag = new ReflectedPropertyBagProvider().CreatePropertyBag <DerivedClassWithPrivateProperties>();

            Assert.That(propertyBag, Is.Not.Null);

            Assert.That(propertyBag.HasProperty(ClassWithPrivateProperties.IntPropertyName), Is.False);
            Assert.That(propertyBag.HasProperty(ClassWithPrivateProperties.FloatPropertyName), Is.True);
            Assert.That(propertyBag.HasProperty(ClassWithPrivateProperties.NonMaskedPropertyName), Is.True);
            Assert.That(propertyBag.HasProperty(DerivedClassWithPrivateProperties.BoolPropertyName), Is.False);
            Assert.That(propertyBag.HasProperty(DerivedClassWithPrivateProperties.StringPropertyName), Is.True);

            var container = new DerivedClassWithPrivateProperties();

            Assert.That(propertyBag.GetPropertyValue(ref container, ClassWithPrivateProperties.FloatPropertyName), Is.EqualTo(123.456f));
            Assert.That(propertyBag.GetPropertyValue(ref container, ClassWithPrivateProperties.NonMaskedPropertyName), Is.EqualTo(2));
            Assert.That(propertyBag.GetPropertyValue(ref container, DerivedClassWithPrivateProperties.StringPropertyName), Is.EqualTo("Hello the World!"));
        }
        public void CreatePropertyBag_ImplementedAbstractClassWithInternalProperties_PropertiesAreGenerated()
        {
            var propertyBag = new ReflectedPropertyBagProvider().CreatePropertyBag <ImplementedAbstractClassWithInternalProperties>();

            Assert.That(propertyBag, Is.Not.Null);

            Assert.That(propertyBag.HasProperty(AbstractClassWithInternalProperties.IntPropertyName), Is.False);
            Assert.That(propertyBag.HasProperty(AbstractClassWithInternalProperties.FloatPropertyName), Is.True);

            var container = new ImplementedAbstractClassWithInternalProperties();

            Assert.That(propertyBag.GetPropertyValue(ref container, AbstractClassWithInternalProperties.FloatPropertyName), Is.EqualTo(3.1416f));
        }