Esempio n. 1
0
        public void Performance()
        {
            var source = new Trillian();

            source.A = "BE5B1F80-B878-44B4-8B61-DEADBEEF0000";
            source.B = 1234.567;
            source.C = 42735.9998842593;
            source.E = "true";

            for (int i = 0; i < 1000000; i++)
            {
                var target = new Marvin();
                _mapper.map(source, target);
            }
        }
Esempio n. 2
0
        public void TestSimpleObjectMapping()
        {
            var source = new Trillian()
            {
                A = "BE5B1F80-B878-44B4-8B61-DEADBEEF0000",
                B = 1234.567,
                C = 42735.9998842593,
                E = "true"
            };

            var target = new Marvin();

            _mapper.map(source, target);

            Assert.AreEqual(Guid.Parse("BE5B1F80-B878-44B4-8B61-DEADBEEF0000"), target.A);
            Assert.AreEqual(1235, target.B);
            Assert.AreEqual(new DateTime(2016, 12, 31, 23, 59, 50), target.C);
            Assert.AreEqual(true, target.E);
        }