public void Validate_IsValid_DoesNotThrows()
        {
            var descriptor = new DummyDesciptor();

            descriptor.Figure = "blue";

            RecursiveValidator.Validate(descriptor);
        }
        public void Figure_Set_ValueIsSet()
        {
            var descriptor = new DummyDesciptor();

            descriptor.Figure = "EPS";

            Assert.That(descriptor.Figure, Is.EqualTo("EPS"));
        }
        public void Figure_Set_ChangeIsNotified()
        {
            var descriptor = new DummyDesciptor();
            var counter    = new PropertyChangedCounter(descriptor);

            descriptor.Figure = "EPS";

            Assert.That(counter.GetCount(nameof(descriptor.Figure)), Is.EqualTo(1));
        }
        public void Validate_InvalidFigure_Throws([Values(null, "")] string figure)
        {
            var descriptor = new DummyDesciptor();

            descriptor.Figure = figure;

            var ex = Assert.Throws <ValidationException>(() => RecursiveValidator.Validate(descriptor));

            Assert.That(ex.Message, Does.Contain("The Figure field is required"));
        }
        public void Clone_WhenCalled_AllMembersAreCloned()
        {
            var descriptor = new DummyDesciptor();

            descriptor.Figure = "blue";

            var clone = FigureDescriptorFactory.Clone(descriptor);

            Assert.That(clone.Figure, Is.EqualTo(descriptor.Figure));
        }