Esempio n. 1
0
        public void HidingTheBaseConstructorWithAParameterizedConstructorDoesNotResultInMappingIfTheBaseConstructorIsNotInherited()
        {
            MappedTypeExampleWithConstructor.IsMapped = false;
            MappedTypeExampleWithConstructor.MapCount = 0;

            for (int i = 0; i < 1000; i++)
            {
                var mte = new MappedTypeExampleWithConstructor(i.ToString());
            }

            Assert.That(MappedTypeExampleWithConstructor.MapCount, Is.EqualTo(1));
        }
Esempio n. 2
0
        public void HidingTheBaseConstructorWithAParameterizedConstructorDoesNotResultInMappingIfTheBaseConstructorIsNotInherited()
        {
            MappedTypeExampleWithConstructor.IsMapped = false;
            MappedTypeExampleWithConstructor.MapCount = 0;

            for (int i = 0; i < 1000; i++)
            {
                var mte = new MappedTypeExampleWithConstructor(i.ToString());
            }

            Assert.That(MappedTypeExampleWithConstructor.MapCount, Is.EqualTo(1));
        }
Esempio n. 3
0
        public void HidingTheBaseConstructorWithAParameterizedConstructorResultsInMappingIfTheBaseConstructorIsInherited()
        {
            MappedTypeExampleWithConstructor.IsMapped = false;
            MappedTypeExampleWithConstructor.MapCount = 0;

            for (int i = 0; i < 1000; i++)
            {
                var mte = new MappedTypeExampleWithConstructor(i.ToString(), "Test");
            }

            // Here, we're expecting the CreateMap method not to be called.  Not ideal.
            Assert.That(MappedTypeExampleWithConstructor.MapCount, Is.EqualTo(1));
        }
Esempio n. 4
0
        public void HidingTheBaseConstructorDoesNotResultInAnError()
        {
            MappedTypeExampleWithConstructor.IsMapped = false;
            MappedTypeExampleWithConstructor.MapCount = 0;

            for (int i = 0; i < 1000; i++)
            {
                var mte = new MappedTypeExampleWithConstructor();
            }

            // Check that the type was mapped once, and only once.
            Assert.That(MappedTypeExampleWithConstructor.MapCount, Is.EqualTo(1));
        }
Esempio n. 5
0
        public void HidingTheBaseConstructorWithAParameterizedConstructorResultsInMappingIfTheBaseConstructorIsInherited()
        {
            MappedTypeExampleWithConstructor.IsMapped = false;
            MappedTypeExampleWithConstructor.MapCount = 0;

            for (int i = 0; i < 1000; i++)
            {
                var mte = new MappedTypeExampleWithConstructor(i.ToString(), "Test");
            }

            // Here, we're expecting the CreateMap method not to be called.  Not ideal.
            Assert.That(MappedTypeExampleWithConstructor.MapCount, Is.EqualTo(1));
        }
Esempio n. 6
0
        public void HidingTheBaseConstructorDoesNotResultInAnError()
        {
            MappedTypeExampleWithConstructor.IsMapped = false;
            MappedTypeExampleWithConstructor.MapCount = 0;

            for (int i = 0; i < 1000; i++)
            {
                var mte = new MappedTypeExampleWithConstructor();
            }

            // Check that the type was mapped once, and only once.
            Assert.That(MappedTypeExampleWithConstructor.MapCount, Is.EqualTo(1));
        }