src/GenFx.Components.Tests/ListEntityTests.cs
/// <summary>
/// Tests that an exception is thrown if the length is changed when the list is a fixed size.
/// </summary>
Tests that an exception is thrown if the length is changed when the list is a fixed size.
Tests that an exception is thrown if the length is changed when the list is a fixed size .
[Fact]
        public void ListEntity_ThrowsWhenLengthChangedOnFixedSizeList()
        {
            TestListEntity<int> entity = new TestListEntity<int>
            {
                MinimumStartingLength = 2,
                MaximumStartingLength = 2,
                IsFixedSize = true
            };
            entity.Initialize(new MockGeneticAlgorithm());
            Assert.Equal(2, entity.Length);
            Assert.Throws<ArgumentException>(() => entity.Length = 4);
        }
[ Fact ] public void ListEntity_ThrowsWhenLengthChangedOnFixedSizeList ( ) { TestListEntity < int > entity = new TestListEntity < int > { MinimumStartingLength = 2 , MaximumStartingLength = 2 , IsFixedSize = true } ; entity . Initialize ( new MockGeneticAlgorithm ( ) ) ; Assert . Equal ( 2 , entity . Length ) ; Assert . Throws < ArgumentException > ( ( ) => entity . Length = 4 ) ; }
Tests that an exception is thrown if the length is changed when the list is a fixed size.
Tests that an exception is thrown if the length is changed when the list is a fixed size .