src/GenFx.Components.Tests/BinaryStringEntityTest.cs
/// <summary>
/// Tests that an exception is thrown when the Length is set to a different value when the string is fixed size.
///</summary>
Tests that an exception is thrown when the Length is set to a different value when the string is fixed size.
Tests that an exception is thrown when the Length is set to a different value when the string is fixed size .
[Fact]
        public void BinaryStringEntity_Length_SetToDifferentValue()
        {
            int length = 50;
            GeneticAlgorithm algorithm = GetAlgorithm(length);
            TestBinaryStringEntity entity = new TestBinaryStringEntity
            {
                MinimumStartingLength = length,
                MaximumStartingLength = length,
                IsFixedSize = true
            };
            entity.Initialize(algorithm);
            Assert.Throws<ArgumentException>(() => entity.Length = 51);
        }
[ Fact ] public void BinaryStringEntity_Length_SetToDifferentValue ( ) { int length = 50 ; GeneticAlgorithm algorithm = GetAlgorithm ( length ) ; TestBinaryStringEntity entity = new TestBinaryStringEntity { MinimumStartingLength = length , MaximumStartingLength = length , IsFixedSize = true } ; entity . Initialize ( algorithm ) ; Assert . Throws < ArgumentException > ( ( ) => entity . Length = 51 ) ; }
Tests that an exception is thrown when the Length is set to a different value when the string is fixed size.
Tests that an exception is thrown when the Length is set to a different value when the string is fixed size .