Exemple #1
0
        public void OverrideChildContext_ValueType_ReturnsNewValue()
        {
            var collection = new MappingCollection <object, object, bool>(null);

            collection.SetChildContext((from, to, context) =>
            {
                Assert.IsTrue(context);
                return(false);
            });
            Assert.IsFalse(collection.ContextUpdater(null, null, true));
        }
Exemple #2
0
        public void OverrideChildContext_ClassType_InvokesClone()
        {
            var testContext = new CloneableTestContext();

            _collection.SetChildContext((from, to, context) =>
            {
                Assert.AreNotSame(testContext, context);
                return(context);
            });
            _collection.ContextUpdater(null, null, testContext);
        }
Exemple #3
0
        public void OverrideChildContext_ThrowsException_UnCloneableClass()
        {
            var collection = new MappingCollection <object, object, NonCloneableTestContext>(null);

            Assert.Throws <InvalidOperationException>(() => collection.SetChildContext((from, to, context) => context));
        }