using UnitTestSharp; namespace Prism.Glass.UnitTests { public class ColorPickerBehaviorTests : TestFixture { public class DefaultTests : TestFixture { public void HasEveryPartFollowTheColor() { CheckTrue(ColorPickerBehavior.Default.DiscShowsValue); CheckTrue(ColorPickerBehavior.Default.ValueStripShowsHueAndSaturation); CheckTrue(ColorPickerBehavior.Default.AlphaStripShowsColor); CheckFalse(ColorPickerBehavior.Default.HexUpdatesWhileTyping); CheckTrue(ColorPickerBehavior.Default.FieldsUpdateWhileScrubbing); } } public class CtorTests : TestFixture { public void HasEveryPartFollowTheColorUnlessTold() { var behavior = new ColorPickerBehavior { AlphaStripShowsColor = false }; CheckTrue(behavior.DiscShowsValue); CheckTrue(behavior.ValueStripShowsHueAndSaturation); CheckFalse(behavior.AlphaStripShowsColor); CheckFalse(behavior.HexUpdatesWhileTyping); } public void CanHaveTheColorWaitForAScrubToEnd() { CheckFalse(new ColorPickerBehavior { FieldsUpdateWhileScrubbing = false }.FieldsUpdateWhileScrubbing); } public void CanHaveTheColorFollowTheHexText() { CheckTrue(new ColorPickerBehavior { HexUpdatesWhileTyping = true }.HexUpdatesWhileTyping); } } } }