示例#1
0
        public void WhenWrongTypeThenShouldThrowException()
        {
            var mapper = new IrrelevantMapper();

            Assert.Throws <InvalidCastException>(() => mapper.Map(new object(), new TestClass()));
            Assert.Throws <InvalidCastException>(() => mapper.Map(new TestClass(), new object()));
        }
示例#2
0
        public void WhenMapperDoesNotMapOrIgnoreAllPropertiesThenValidateShouldFail()
        {
            var mapper = new IrrelevantMapper();

            Assert.Throws <MissingMappingException>(() => mapper.ValidateMapping());
        }