Esempio n. 1
0
 private bool IsColumnVisibleForBocDropDownMenuColumnDefinition(BocDropDownMenuColumnDefinition column)
 {
     if (_wcagHelper.IsWaiConformanceLevelARequired())
     {
         return(false);
     }
     return(IsBrowserCapableOfScripting);
 }
        public void BocDropDownMenuColumnDefinition_IsWaiConformanceLevelARequired_True()
        {
            var columnDefinition = new BocDropDownMenuColumnDefinition();
            var builder          = new BocColumnRendererArrayBuilder(new[] { columnDefinition }, _serviceLocator, _wcagHelperStub);

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

            var bocColumnRenderers = builder.CreateColumnRenderers();

            Assert.That(bocColumnRenderers.Length, Is.EqualTo(1));
            Assert.That(bocColumnRenderers[0].IsVisibleColumn, Is.False);
            Assert.That(PrivateInvoke.GetNonPublicField(bocColumnRenderers[0], "_columnRenderer"), Is.TypeOf(typeof(NullColumnRenderer)));
        }
Esempio n. 3
0
        public void EvaluateWaiConformityDebugLevelAWithDropDownMenuColumn()
        {
            WebConfigurationMock.Current = WebConfigurationFactory.GetDebugExceptionLevelA();
            BocDropDownMenuColumnDefinition dropDownMenuColumn = new BocDropDownMenuColumnDefinition();

            _bocList.EvaluateWaiConformity(new BocColumnDefinition[1] {
                dropDownMenuColumn
            });

            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]"));
        }
        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();
        }