Example #1
0
        public void DoRemove_ICollection_Should_throw_ArgumentNullException_When_source_is_null()
        {
            IUnDoManager         manager = Substitute.For <IUnDoManager>();
            ICollection <object> source  = null;

            Check
            .ThatCode(() => manager.DoRemove(source, null))
            .Throws <ArgumentNullException>()
            .WithProperty("ParamName", "source");
        }
Example #2
0
        public void DoRemove_IDictionary_Should_throw_ArgumentNullException_When_key_is_null()
        {
            IUnDoManager manager = Substitute.For <IUnDoManager>();
            IDictionary <object, object> source = Substitute.For <IDictionary <object, object> >();
            object key = null;

            Check
            .ThatCode(() => manager.DoRemove(source, key))
            .Throws <ArgumentNullException>()
            .WithProperty("ParamName", "key");
        }
Example #3
0
 bool ICollection <T> .Remove(T item) => _manager.DoRemove(_source, item, _descriptionFactory?.Invoke(new UnDoCollectionOperation(this, UnDoCollectionAction.ICollectionRemove, item)));