Exemple #1
0
        public override void SetUp()
        {
            base.SetUp();

            _values    = new IBusinessObject[5];
            _values[0] = (IBusinessObject)TypeWithString.Create("0", "A");
            _values[1] = (IBusinessObject)TypeWithString.Create("1", "A");
            _values[2] = (IBusinessObject)TypeWithString.Create("2", "B");
            _values[3] = (IBusinessObject)TypeWithString.Create("3", "B");
            _values[4] = (IBusinessObject)TypeWithString.Create("4", "C");

            _newValues    = new IBusinessObject[2];
            _newValues[0] = (IBusinessObject)TypeWithString.Create("5", "C");
            _newValues[1] = (IBusinessObject)TypeWithString.Create("6", "D");

            _typeWithStringClass = BindableObjectProviderTestHelper.GetBindableObjectClass(typeof(TypeWithString));

            _typeWithStringFirstValuePath  = BusinessObjectPropertyPath.CreateStatic(_typeWithStringClass, "FirstValue");
            _typeWithStringSecondValuePath = BusinessObjectPropertyPath.CreateStatic(_typeWithStringClass, "SecondValue");

            _typeWithStringFirstValueSimpleColumn = new BocSimpleColumnDefinition();
            _typeWithStringFirstValueSimpleColumn.SetPropertyPath(_typeWithStringFirstValuePath);

            _typeWithStringSecondValueSimpleColumn = new BocSimpleColumnDefinition();
            _typeWithStringSecondValueSimpleColumn.SetPropertyPath(_typeWithStringSecondValuePath);

            _bocList    = new BocListMock();
            _bocList.ID = "BocList";
            NamingContainer.Controls.Add(_bocList);

            _bocList.LoadUnboundValue(_values, false);
            _bocList.SwitchListIntoEditMode();

            Assert.That(_bocList.IsListEditModeActive, Is.True);
        }
        public void LoadUnboundValueAndInterimTrueWithListAndDirty()
        {
            TypeWithReference[] value = new[] { TypeWithReference.Create(), TypeWithReference.Create() };
            _bocList.DataSource = _dataSource;
            _bocList.Value      = null;
            _bocList.IsDirty    = true;

            _bocList.LoadUnboundValue(value, true);
            Assert.That(_bocList.Value, Is.SameAs(value));
            Assert.That(_bocList.IsDirty, Is.True);
        }
Exemple #3
0
 public void AddRowWithoutValue()
 {
     _bocList.LoadUnboundValue(null, false);
     _bocList.AddRow(_newValues[0]);
 }