Example #1
0
        public void IBusinessObjectEnumerationProperty_GetEnabledValues()
        {
            IBusinessObjectEnumerationProperty property = CreateProperty("NullableScalar");

            BooleanEnumerationValueInfo[] expected = new []
            {
                new BooleanEnumerationValueInfo(true, (IBusinessObjectBooleanProperty)property),
                new BooleanEnumerationValueInfo(false, (IBusinessObjectBooleanProperty)property)
            };

            CheckEnumerationValueInfos(expected, property.GetEnabledValues(null));
        }
Example #2
0
        public void DisableWithBusinessObject()
        {
            IBusinessObjectEnumerationProperty property = CreateProperty(typeof(ClassWithDisabledEnumValue), "DisabledWithObject");

            EnumerationValueInfo[] expected = new[]
            {
                new EnumerationValueInfo(TestEnum.Value1, "Value1", "Value1", true),
                new EnumerationValueInfo(TestEnum.Value3, "Value3", "Value3", true),
                new EnumerationValueInfo(TestEnum.Value5, "Value5", "Value5", true),
            };

            CheckEnumerationValueInfos(expected, property.GetEnabledValues(MockRepository.GenerateStub <IBusinessObject>()));
        }
Example #3
0
        public void DisableFromPropertyType()
        {
            IBusinessObjectEnumerationProperty property = CreateProperty(typeof(ClassWithDisabledEnumValue), "DisabledFromPropertyType");

            EnumerationValueInfo[] expected = new[]
            {
                new EnumerationValueInfo(TestEnum.Value1, "Value1", "Value1", true),
                new EnumerationValueInfo(TestEnum.Value2, "Value2", "Value2", true),
                new EnumerationValueInfo(TestEnum.Value3, "Value3", "Value3", true),
                new EnumerationValueInfo(TestEnum.Value4, "Value4", "Value4", true)
            };

            CheckEnumerationValueInfos(expected, property.GetEnabledValues(null));
        }