Example #1
0
		public void NullableDoublePropertyViewModelTest()
		{
			// Since this property viewmodel commits its change as soon as the change is made, the commitChange method
			// is executed, which requires a working IoC
			IoC.GetInstance = IoCAggregator;

			NullableDoublePropertyViewModel en = new NullableDoublePropertyViewModel();
			BrightnessContrastSaturationNode bcs = new BrightnessContrastSaturationNode();
			PropertyDescriptor pd = TypeDescriptor.GetProperties(bcs).Find("contrast", true);
			en.Initialize(bcs, pd);

			Assert.True(en.SlidersAreEnabled);
			Assert.Equal(pd.Attributes.OfType<RangeAttribute>().First().Maximum, en.Maximum);
			Assert.Equal(pd.Attributes.OfType<RangeAttribute>().First().Minimum, en.Minimum);
		}
Example #2
0
        public void NullableDoublePropertyViewModelTest()
        {
            // Since this property viewmodel commits its change as soon as the change is made, the commitChange method
            // is executed, which requires a working IoC
            IoC.GetInstance = IoCAggregator;

            NullableDoublePropertyViewModel  en  = new NullableDoublePropertyViewModel();
            BrightnessContrastSaturationNode bcs = new BrightnessContrastSaturationNode();
            PropertyDescriptor pd = TypeDescriptor.GetProperties(bcs).Find("contrast", true);

            en.Initialize(bcs, pd);

            Assert.True(en.SlidersAreEnabled);
            Assert.Equal(pd.Attributes.OfType <RangeAttribute>().First().Maximum, en.Maximum);
            Assert.Equal(pd.Attributes.OfType <RangeAttribute>().First().Minimum, en.Minimum);
        }