Exemplo n.º 1
0
        public void Should_map_source_to_list()
        {
            var result = new TestValueMapper().Map(new ValueMapperContext(null,
                                                                          null, Properties[nameof(Model.List)], new object[] { "1,2,3" }));

            result.ShouldBeType <List <int> >();
            result.CastTo <List <int> >().ShouldOnlyContain(1, 2, 3);
        }
Exemplo n.º 2
0
        public void Should_map_source_to_value()
        {
            var result = new TestValueMapper().Map(new ValueMapperContext(null,
                                                                          null, Properties[nameof(Model.Value)], new object[] { "1,2,3" }));

            result.ShouldBeType <int>();
            result.CastTo <int>().ShouldEqual(1);
        }