public void ShouldUseInstantiatorThatHasBeenSet()
        {
            TestInstantiator instantiator = new TestInstantiator();

            table = NetReflectorTypeTable.CreateDefault(instantiator);
            ReadTestHashClassContainingElements();
            Assert.AreEqual(4, instantiator.instantiateCallCount);
        }
예제 #2
0
        public void ShouldUseInstantiatorThatHasBeenSet()
        {
            TestInstantiator instantiator = new TestInstantiator();

            table = NetReflectorTypeTable.CreateDefault(instantiator);
            ReadCollectionTestClass();
            Assert.AreEqual(4, instantiator.instantiateCallCount);
        }
예제 #3
0
        public void ShouldUseCustomInstantiatorIfUsed()
        {
            TestInstantiator      instantiator = new TestInstantiator();
            NetReflectorTypeTable table        = new NetReflectorTypeTable(instantiator);

            table.Add(typeof(TestClass));

            Assert.AreEqual(instantiator, ((XmlTypeSerialiser)table["reflectTest"]).Instantiator);
        }