Пример #1
0
        public void it_can_transparently_convert_values()
        {
            var src = new IntegerSource()
            {
                AnInt = 3
            };
            var cfg = new DestinationConfiguration(typeof(IntegerDest));

            cfg.From(typeof(IntegerSource));
            var executable = cfg.ToExecutable(src.GetType());
            var mapper     = new DefaultMapCommand(executable, new TestContextualizer());
            var dest       = (IntegerDest)mapper.From(src);

            dest.AnInt.should_be_equal_to(3);
        }
Пример #2
0
 public void it_can_transparently_convert_values()
 {
     var src = new IntegerSource() {AnInt = 3};
     var cfg = new DestinationConfiguration(typeof(IntegerDest));
     cfg.From(typeof (IntegerSource));
     var executable = cfg.ToExecutable(src.GetType());
     var mapper = new DefaultMapCommand(executable, new TestContextualizer());
     var dest = (IntegerDest)mapper.From(src);
     dest.AnInt.should_be_equal_to(3);
 }