Esempio n. 1
0
        public void Clear_NoCacheInvalidation_WhenNothingToClear()
        {
            _wrappedData.Clear();

            WarmUpCache(_decoratorWithRealData, false);
            Assert.That(_decoratorWithRealData.IsCacheUpToDate, Is.True);

            _decoratorWithRealData.Clear();

            Assert.That(_decoratorWithRealData.IsCacheUpToDate, Is.True);
        }
        public static void ReplaceContents(this IDomainObjectCollectionData data, IEnumerable <DomainObject> domainObjects)
        {
            ArgumentUtility.CheckNotNull("data", data);
            ArgumentUtility.CheckNotNull("domainObjects", domainObjects);

            data.Clear();
            data.AddRange(domainObjects);
        }
 public virtual void Clear()
 {
     _wrappedData.Clear();
 }
        /// <summary>
        /// Removes all items from the <see cref="DomainObjectCollection"/>.
        /// </summary>
        /// <exception cref="System.NotSupportedException">The collection is read-only.</exception>
        public void Clear()
        {
            this.CheckNotReadOnly("Cannot clear a read-only collection.");

            _dataStrategy.Clear();
        }