示例#1
0
        public void TypeNameForNullable_NamedType_ShouldMapToType()
        {
            var actual = TypeNameMapper.TypeNameForNullableType(typeof(int).FullName);
            var actualCorrespondingType   = Type.GetType(actual);
            var expectedCorrespondingType = typeof(Nullable <int>);

            Assert.That(actualCorrespondingType, Is.EqualTo(expectedCorrespondingType));
        }
示例#2
0
        public void TypeNameForArray_ArrayTypeOfSimpleTypeRankTwo_ShouldMapToType()
        {
            var actual = TypeNameMapper.TypeNameForArray(typeof(double).FullName,
                                                         new RankSpecifiers(new[] { new RankSpecifier(2) }));
            var correspondingType = Type.GetType(actual);

            Assert.That(correspondingType, Is.EqualTo(typeof(double[, ])));
        }
示例#3
0
        public void TypeNameForArray_ArrayTypeOfSimpleTypeRankOneTwoThree_ShouldMapToType()
        {
            var actual = TypeNameMapper.TypeNameForArray(typeof(float).FullName,
                                                         new RankSpecifiers(new[]
            {
                new RankSpecifier(1),
                new RankSpecifier(2),
                new RankSpecifier(3)
            }));
            var correspondingType = Type.GetType(actual);

            Assert.That(correspondingType, Is.EqualTo(typeof(float[][, ][, , ])));
        }
 public StructureDefinitionSummaryProvider(IResourceResolver resolver, TypeNameMapper mapper = null)
 {
     _resolver       = resolver;
     _typeNameMapper = mapper ?? DefaultTypeNameMapper;
 }