src/GenFx.Tests/GeneticAlgorithmTest.cs
/// <summary>
/// Tests that the <see cref="GeneticAlgorithm.AlgorithmCompleted"/> event is raised correctly
/// when the user manually "completes" the algorithm.
/// </summary>
Tests that the  event is raised correctly
when the user manually "completes" the algorithm.
Tests that the event is raised correctly when the user manually " completes " the algorithm .
[Fact]
        public void GeneticAlgorithm_AlgorithmCompletedEvent_Manual()
        {
            MockGeneticAlgorithm algorithm = new MockGeneticAlgorithm();
            AlgorithmCompletedPlugin plugin = new AlgorithmCompletedPlugin();
            algorithm.Plugins.Add(plugin);
            plugin.Initialize(algorithm);
            bool eventRaised = false;
            algorithm.AlgorithmCompleted += (sender, eventObj) =>
            {
                eventRaised = true;
            };
            algorithm.Complete();
            Assert.True(eventRaised);
            Assert.True(plugin.OnAlgorithmCompletedWasCalled);
        }
[ Fact ] public void GeneticAlgorithm_AlgorithmCompletedEvent_Manual ( ) { MockGeneticAlgorithm algorithm = new MockGeneticAlgorithm ( ) ; AlgorithmCompletedPlugin plugin = new AlgorithmCompletedPlugin ( ) ; algorithm . Plugins . Add ( plugin ) ; plugin . Initialize ( algorithm ) ; bool eventRaised = false ; algorithm . AlgorithmCompleted += ( sender , eventObj ) => { eventRaised = true ; } ; algorithm . Complete ( ) ; Assert . True ( eventRaised ) ; Assert . True ( plugin . OnAlgorithmCompletedWasCalled ) ; }
Tests that the  event is raised correctly
when the user manually "completes" the algorithm.
Tests that the event is raised correctly when the user manually " completes " the algorithm .