Пример #1
0
 private bool IsColumnVisibleForBocCommandColumnDefinition(BocCommandColumnDefinition columnAsCommandColumn)
 {
     if (_wcagHelper.IsWaiConformanceLevelARequired() &&
         (columnAsCommandColumn.Command.Type == CommandType.Event || columnAsCommandColumn.Command.Type == CommandType.WxeFunction))
     {
         return(false);
     }
     return(true);
 }
Пример #2
0
        public void EvaluateWaiConformityDebugLevelAWithCommandColumnWithoutCommand()
        {
            WebConfigurationMock.Current = WebConfigurationFactory.GetDebugExceptionLevelA();
            BocCommandColumnDefinition commandColumn = new BocCommandColumnDefinition();

            commandColumn.Command = null;
            _bocList.EvaluateWaiConformity(new BocColumnDefinition[1] {
                commandColumn
            });

            Assert.That(WcagHelperMock.HasWarning, Is.False);
            Assert.That(WcagHelperMock.HasError, Is.False);
        }
        public void BocCommandColumnDefinition_IsWaiConformanceLevelARequired_False_And_CommandType_WxeFunction()
        {
            var columnDefinition = new BocCommandColumnDefinition();

            columnDefinition.Command = new BocListItemCommand(CommandType.WxeFunction);
            var builder = new BocColumnRendererArrayBuilder(new[] { columnDefinition }, _serviceLocator, _wcagHelperStub);

            _wcagHelperStub.Stub(stub => stub.IsWaiConformanceLevelARequired()).Return(false);

            var bocColumnRenderers = builder.CreateColumnRenderers();

            Assert.That(bocColumnRenderers.Length, Is.EqualTo(1));
            Assert.That(bocColumnRenderers[0].IsVisibleColumn, Is.True);
            Assert.That(PrivateInvoke.GetNonPublicField(bocColumnRenderers[0], "_columnRenderer"), Is.Not.TypeOf(typeof(NullColumnRenderer)));
        }
Пример #4
0
        public void EvaluateWaiConformityDebugLevelAWithCommandColumnSetToWxeFunction()
        {
            WebConfigurationMock.Current = WebConfigurationFactory.GetDebugExceptionLevelA();
            BocCommandColumnDefinition commandColumn = new BocCommandColumnDefinition();

            commandColumn.Command.Type = CommandType.WxeFunction;
            _bocList.EvaluateWaiConformity(new BocColumnDefinition[1] {
                commandColumn
            });

            Assert.That(WcagHelperMock.HasError, Is.True);
            Assert.That(WcagHelperMock.Priority, Is.EqualTo(1));
            Assert.That(WcagHelperMock.Control, Is.SameAs(_bocList));
            Assert.That(WcagHelperMock.Property, Is.EqualTo("Columns[0].Command"));
        }
        public override void SetUp()
        {
            base.SetUp();

            _editModeHost                           = new FakeEditModeHost();
            _editModeHost.ID                        = "BocList";
            _editModeHost.RowIDProvider             = new FakeRowIDProvider();
            _editModeHost.EditModeControlFactory    = EditableRowControlFactory.CreateEditableRowControlFactory();
            _editModeHost.EditModeDataSourceFactory = new EditableRowDataSourceFactory();

            _editableRow    = new EditableRow(_editModeHost);
            _editableRow.ID = "Row";
            NamingContainer.Controls.Add(_editableRow);

            _value01 = (IBusinessObject)TypeWithAllDataTypes.Create("A", 1);

            _typeWithAllDataTypesClass = BindableObjectProviderTestHelper.GetBindableObjectClass(typeof(TypeWithAllDataTypes));

            _typeWithAllDataTypesStringValuePath = BusinessObjectPropertyPath.CreateStatic(_typeWithAllDataTypesClass, "String");
            _typeWithAllDataTypesInt32ValuePath  = BusinessObjectPropertyPath.CreateStatic(_typeWithAllDataTypesClass, "Int32");

            _typeWithAllDataTypesStringValueSimpleColumn = new BocSimpleColumnDefinition();
            _typeWithAllDataTypesStringValueSimpleColumn.SetPropertyPath(_typeWithAllDataTypesStringValuePath);

            _typeWithAllDataTypesStringValueSimpleColumnAsDynamic = new BocSimpleColumnDefinition();
            _typeWithAllDataTypesStringValueSimpleColumnAsDynamic.SetPropertyPath(BusinessObjectPropertyPath.CreateDynamic("StringValue"));
            _typeWithAllDataTypesStringValueSimpleColumnAsDynamic.IsDynamic = true;

            _typeWithAllDataTypesInt32ValueSimpleColumn = new BocSimpleColumnDefinition();
            _typeWithAllDataTypesInt32ValueSimpleColumn.SetPropertyPath(_typeWithAllDataTypesInt32ValuePath);

            _typeWithAllDataTypesStringValueFirstValueCompoundColumn = new BocCompoundColumnDefinition();
            _typeWithAllDataTypesStringValueFirstValueCompoundColumn.PropertyPathBindings.Add(
                new PropertyPathBinding(_typeWithAllDataTypesStringValuePath));
            _typeWithAllDataTypesStringValueFirstValueCompoundColumn.PropertyPathBindings.Add(
                new PropertyPathBinding(_typeWithAllDataTypesStringValuePath));
            _typeWithAllDataTypesStringValueFirstValueCompoundColumn.FormatString = "{0}, {1}";

            _typeWithAllDataTypesStringValueCustomColumn = new BocCustomColumnDefinition();
            _typeWithAllDataTypesStringValueCustomColumn.SetPropertyPath(_typeWithAllDataTypesStringValuePath);
            _typeWithAllDataTypesStringValueCustomColumn.IsSortable = true;

            _commandColumn      = new BocCommandColumnDefinition();
            _rowEditModeColumn  = new BocRowEditModeColumnDefinition();
            _dropDownMenuColumn = new BocDropDownMenuColumnDefinition();
        }