示例#1
0
        public void SingleMapping()
        {
            var provider = new MapperProvider();

            provider.RegisterAssembly(Assembly.GetExecutingAssembly());

            Assert.NotNull(provider.GetMapper <MapperProviderTests>());
        }
示例#2
0
        public void NoMapping()
        {
            var provider = new MapperProvider();

            provider.RegisterAssembly(Assembly.GetExecutingAssembly());

            Assert.Throws <ArgumentOutOfRangeException>(() => provider.GetMapper <string>());
        }
示例#3
0
        public void DuplicateMappings()
        {
            var provider = new MapperProvider();

            provider.RegisterAssembly(Assembly.GetExecutingAssembly());


            Assert.Throws <MappingException>(() => provider.Register(new CustomMapper()));
        }