public void SaveValues()
        {
            var mockControl1 = _mockRepository.StrictMock <IBusinessObjectBoundEditableControl>();
            var mockControl2 = _mockRepository.StrictMock <IBusinessObjectBoundEditableControl>();

            SetupResult.For(mockControl1.HasValidBinding).Return(true);
            SetupResult.For(mockControl2.HasValidBinding).Return(true);
            SetupResult.For(mockControl1.SaveValue(true)).Return(true);
            SetupResult.For(mockControl2.SaveValue(true)).Return(true);
            _mockRepository.ReplayAll();

            _dataSource.Register(mockControl1);
            _dataSource.Register(mockControl2);
            var result = _dataSource.SaveValues(true);

            Assert.That(result, Is.True);
            _mockRepository.VerifyAll();
        }
Beispiel #2
0
 /// <summary>
 ///   Saves the values of the <see cref="BusinessObject"/> from all bound controls implementing <see cref="IBusinessObjectBoundEditableControl"/>.
 /// </summary>
 /// <param name="interim"> Spefifies whether this is the final saving, or an interim saving. </param>
 /// <returns><see langword="true"/> if all bound controls have saved their value into the <see cref="IBusinessObjectDataSource.BusinessObject"/>.</returns>
 /// <remarks>
 ///   Executes the <see cref="IBusinessObjectDataSource.SaveValues"/> method of the encapsulated  <see cref="IBusinessObjectDataSource"/>.
 ///   <note>
 ///     Please refer to the <see cref="T:Remotion.ObjectBinding.Web.UI.Controls.IBusinessObjectDataSourceControl" />'s
 ///     remarks section for an example of the <b>SaveValues Pattern</b>.
 ///   </note>
 /// </remarks>
 public virtual bool SaveValues(bool interim)
 {
     return(InnerDataSource.SaveValues(interim));
 }