Beispiel #1
0
        public void CreateIsReadOnlyMethod_ClassWithDynamicReadOnlyProperty_ReturnResultFromValidationMethod(bool isReadOnly)
        {
            // Setup
            var o = new ClassWithDynamicReadOnlyProperty(isReadOnly);

            // Call
            DynamicReadOnlyValidationMethodAttribute.IsPropertyReadOnly result = DynamicReadOnlyValidationMethodAttribute.CreateIsReadOnlyMethod(o);

            // Assert
            Assert.AreEqual(isReadOnly, result("Property"));
        }
        public void IsReadOnly_ClassWithDynamicReadOnlyProperty_ReturnResultFromValidationMethod(bool isReadOnly)
        {
            // Setup
            var o = new ClassWithDynamicReadOnlyProperty(isReadOnly);

            // Call
            bool result = DynamicReadOnlyAttribute.IsReadOnly(o, "Property");

            // Assert
            Assert.AreEqual(isReadOnly, result);
        }