예제 #1
0
        public void Map_Copies_All_Properties_LoadTest()
        {
            var b = new TypeB()
            {
                Foo = 42,
                Bar = 22,
                Baz = "ross",
                Fizz = new DateTime(1986, 8, 22)
            };

            var watch = Stopwatch.StartNew();

            for (int i = 0; i < 100000; i++)
            {
                var a = Mapper.Map<TypeB, TypeA>(b);
            }

            watch.Stop();

            Debug.WriteLine("elapsed: {0}ms", watch.ElapsedMilliseconds);
        }
예제 #2
0
        public void Map_Copies_All_Properties_Reverse()
        {
            var b = new TypeB()
            {
                Foo = 42,
                Bar = 22,
                Baz = "ross",
                Fizz = new DateTime(1986, 8, 22)
            };

            var a = Mapper.Map<TypeB, TypeA>(b);

            Assert.Equal(b.Foo, a.Foo);
            Assert.Equal(b.Bar, a.Bar);
            Assert.Equal(b.Baz, a.Baz);
            Assert.Equal(b.Fizz, a.Fizz);
        }