コード例 #1
0
        public void CreatingMultipleInstancesOfTheMappedTypeResultsInASingleCallToAutoMapperCreateMap()
        {
            MappedTypeExample.IsMapped = false;
            MappedTypeExample.MapCount = 0;

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

            // Check that the type was mapped once, and only once.
            Assert.That(MappedTypeExample.MapCount, Is.EqualTo(1));
        }
コード例 #2
0
        public void CreatingMultipleInstancesOfTheMappedTypeResultsInASingleCallToAutoMapperCreateMap()
        {
            MappedTypeExample.IsMapped = false;
            MappedTypeExample.MapCount = 0;

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

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