Exemplo 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));
        }
Exemplo 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));
        }
Exemplo 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));
        }
Exemplo 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));
        }
Exemplo 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));
        }
Exemplo 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));
        }