コード例 #1
0
        public void CanMapSimpleNullableTypes(Type type, string expectedParamType, string expectedFormat = "")
        {
            var mapper = new TypeMapper();
            var inputParam = new InputParameter { Type = type };
            var param = mapper.Map(inputParam);

            Assert.AreEqual(expectedParamType, param.type);
            Assert.AreEqual(expectedFormat, param.format);

            Assert.IsEmpty(mapper.Models);
        }
コード例 #2
0
 public Parameter Map(InputParameter param)
 {
     var mapping = Register(param.Type);
     return new Parameter { type = mapping.Type, format = mapping.Format, name = param.Name, required = param.IsRequired };
 }