src/GenFx.Tests/GeneticComponentTest.cs
/// <summary>
/// Verifies that the <see cref="GeneticComponent.SetProperty"/> method works correctly.
/// </summary>
Verifies that the  method works correctly.
Verifies that the method works correctly .
[Fact]
        public void GeneticComponent_SetProperty()
        {
            TestComponent component = new TestComponent();
            bool eventRaised = false;
            component.PropertyChanged += (sender, args) =>
            {
                eventRaised = true;
                Assert.Equal(nameof(TestComponent.IntValue), args.PropertyName);
            };
            component.IntValue = 10;
            Assert.True(eventRaised);
            Assert.Throws<ValidationException>(() => component.IntValue = 11);
        }
[ Fact ] public void GeneticComponent_SetProperty ( ) { TestComponent component = new TestComponent ( ) ; bool eventRaised = false ; component . PropertyChanged += ( sender , args ) => { eventRaised = true ; Assert . Equal ( nameof ( TestComponent . IntValue ) , args . PropertyName ) ; } ; component . IntValue = 10 ; Assert . True ( eventRaised ) ; Assert . Throws < ValidationException > ( ( ) => component . IntValue = 11 ) ; }
Verifies that the  method works correctly.
Verifies that the method works correctly .
// Set the property to an invalid value to ensure validation is executed.