Exemplo n.º 1
0
        public void TestThatPropertyChangeCalled(string prop, byte value)
        {
            NotifyableColor color    = new NotifyableColor(Colors.Black);
            var             property = color.GetType().GetProperty(prop);

            Assert.NotNull(property);
            Assert.PropertyChanged(color, prop, () => property.SetValue(color, value));
        }
Exemplo n.º 2
0
 public ColorPicker()
 {
     InitializeComponent();
     _colorPalette   = FindName("colorPalette") as Image;
     _dispatcher     = Application.Current.Dispatcher;
     NotifyableColor = new NotifyableColor(SelectedColor);
     NotifyableColor.ColorChanged   += SelectedColor_ColorChanged;
     _colorPalette.IsVisibleChanged += _colorPalette_IsVisibleChanged;
 }
Exemplo n.º 3
0
        public void TestThatSetArgbWorks()
        {
            NotifyableColor color = new NotifyableColor();

            color.SetArgb(2, 2, 2, 2);
            Assert.Equal(2, color.A);
            Assert.Equal(2, color.R);
            Assert.Equal(2, color.G);
            Assert.Equal(2, color.B);
        }
Exemplo n.º 4
0
        public void TestThatEventCalled(string prop, byte value)
        {
            bool            eventCalled = false;
            NotifyableColor color       = new NotifyableColor(Colors.Black);
            var             property    = color.GetType().GetProperty(prop);

            color.ColorChanged += (s, e) => eventCalled = true;
            Assert.NotNull(property);

            property.SetValue(color, value);

            Assert.True(eventCalled);
        }