Exemplo n.º 1
0
        public void TestExternalColourSetAfterCreation()
        {
            ColourPicker colourPicker = null;

            AddStep("create picker", () => Child = colourPicker = new BasicColourPicker());
            AddStep("set colour externally", () => colourPicker.Current.Value = Colour4.Goldenrod);
            AddAssert("colour is correct", () => colourPicker.Current.Value == Colour4.Goldenrod);
        }
Exemplo n.º 2
0
        public void TestExternalHSVChange()
        {
            const float hue        = 0.34f;
            const float saturation = 0.46f;
            const float value      = 0.84f;

            ColourPicker colourPicker = null;

            AddStep("create picker", () => Child = colourPicker = new BasicColourPicker
            {
                Current = { Value = Colour4.Goldenrod }
            });
            AddStep("hide picker", () => colourPicker.Hide());
            AddStep("set HSV manually", () =>
            {
                var saturationValueControl = this.ChildrenOfType <HSVColourPicker.SaturationValueSelector>().Single();

                saturationValueControl.Hue.Value        = hue;
                saturationValueControl.Saturation.Value = saturation;
                saturationValueControl.Value.Value      = value;
            });

            AddUntilStep("colour is correct", () => colourPicker.Current.Value == Colour4.FromHSV(hue, saturation, value));
        }