public void Should_add_columns_once_when_multiple_calls_to_autogenerate()
        {
            const int expectedColumnCount = 7;

            GridColumnFactory <Customer> factory = Factory <Customer>();

            factory.AutoGenerate(true);
            factory.AutoGenerate(true);
            factory.AutoGenerate(true);

            Assert.Equal(expectedColumnCount, factory.Container.Columns.Count);
        }
        public void Should_not_add_columns_if_autogenerate_is_false_and_no_columns_declared()
        {
            GridColumnFactory <Customer> factory = Factory <Customer>();

            factory.AutoGenerate(false);

            Assert.Empty(factory.Container.Columns);
        }
        public void Should_add_columns_to_grid_when_autogenerate_is_true()
        {
            GridColumnFactory <Customer> factory = Factory <Customer>();

            factory.AutoGenerate(true);

            Assert.Equal(7, factory.Container.Columns.Count);
        }
        public void Should_set_Component_AutoGenerateColumns_to__the_same_value_as_AutoGenerate()
        {
            GridColumnFactory <Customer> factory = Factory <Customer>();

            factory.AutoGenerate(true);

            Assert.True(factory.Container.AutoGenerateColumns);
        }
        public void Should_add_both_autogenerated_columns_and_declared_columns_when_autogenerate_is_true()
        {
            const int expectedColumnCount = 8;

            GridColumnFactory <Customer> factory = Factory <Customer>();

            factory.AutoGenerate(true);
            factory.Bound(c => c.Address);

            Assert.Equal(expectedColumnCount, factory.Container.Columns.Count);
        }
        public void Should_execute_ColumnAction_for_each_autogenerated_column()
        {
            int       calledCounter       = 0;
            const int expectedTimesCalled = 7;

            GridColumnFactory <Customer> factory = Factory <Customer>();

            factory.AutoGenerate(c => ++ calledCounter);

            calledCounter.ShouldEqual(expectedTimesCalled);
        }