public void Can_Convert_Props_With_CustomTypeConverter()
        {
            AutoMappingUtils.RegisterConverter((WrappedDateTimeOffset from) => from.ToDateTimeOffset());

            var personWithWrappedDateOfBirth = new PersonWithWrappedDateOfBirth
            {
                FirstName   = "Foo",
                LastName    = "Bar",
                DateOfBirth = new WrappedDateTimeOffset(
                    new DateTimeOffset(1971, 3, 23, 4, 30, 0, TimeSpan.Zero))
            };

            var personWithDoB = personWithWrappedDateOfBirth.ConvertTo <PersonWithDateOfBirth>();

            Assert.That(personWithDoB.FirstName, Is.EqualTo("Foo"));
            Assert.That(personWithDoB.LastName, Is.EqualTo("Bar"));
            Assert.That(personWithDoB.DateOfBirth, Is.Not.Null);
            Assert.That(personWithDoB.DateOfBirth.Year, Is.EqualTo(1971));
            Assert.That(personWithDoB.DateOfBirth.Month, Is.EqualTo(3));
            Assert.That(personWithDoB.DateOfBirth.Day, Is.EqualTo(23));
            Assert.That(personWithDoB.DateOfBirth.Hour, Is.EqualTo(4));
            Assert.That(personWithDoB.DateOfBirth.Minute, Is.EqualTo(30));
            Assert.That(personWithDoB.DateOfBirth.Second, Is.EqualTo(0));

            AutoMappingUtils.Reset();
        }
        public void Should_Not_Throw_Exception_When_Multiple_Same_Type_CustomTypeConverters_Found()
        {
            AutoMappingUtils.RegisterConverter((DateTimeOffset from) => new WrappedDateTimeOffset(from));

            var personWithWrappedDateOfBirth = new PersonWithWrappedDateOfBirth
            {
                DateOfBirth = new WrappedDateTimeOffset(
                    new DateTimeOffset(1971, 3, 23, 4, 30, 0, TimeSpan.Zero))
            };

            var personWithDoB = personWithWrappedDateOfBirth.ConvertTo <PersonWithDateOfBirth>();

            // Object returned but mapping failed
            Assert.That(personWithDoB.FirstName, Is.Null);
            Assert.That(personWithDoB.LastName, Is.Null);
            Assert.That(personWithDoB.DateOfBirth, Is.EqualTo(DateTimeOffset.MinValue));

            AutoMappingUtils.Reset();
        }