예제 #1
0
        public void SystemTypeFor_ArrayTypeOfSimpleTypeRankTwo_ShouldMapToType()
        {
            var actual = SystemTypeMapper.SystemTypeFor(new ArrayType(new SimpleType(typeof(double)),
                                                                      new RankSpecifiers(new[] { new RankSpecifier(2) })));

            Assert.That(actual, Is.EqualTo(typeof(double[, ])));
        }
예제 #2
0
        public void SystemTypeFor_ArrayTypeOfSimpleTypeRankOneTwoThree_ShouldMapToType()
        {
            var actual = SystemTypeMapper.SystemTypeFor(new ArrayType(new SimpleType(typeof(float)),
                                                                      new RankSpecifiers(new[]
            {
                new RankSpecifier(1),
                new RankSpecifier(2),
                new RankSpecifier(3)
            })));

            Assert.That(actual, Is.EqualTo(typeof(float[][, ][, , ])));
        }
예제 #3
0
        public void IsSystemType_ForTypeNameTypeNodeKnownType_ShouldBeTrue()
        {
            var actual = SystemTypeMapper.IsSystemType(new TypeName("Guid"));

            Assert.That(actual, Is.True);
        }
예제 #4
0
        public void SystemTypeFor_NamedTypeFromSystemNamespaceGuid_ShouldMapToType()
        {
            var actual = SystemTypeMapper.SystemTypeFor(new TypeName("Guid"));

            Assert.That(actual, Is.EqualTo(typeof(Guid)));
        }
예제 #5
0
        public void SystemTypeFor_NamedTypeFromSystemNamespaceDateTime_ShouldMapToType()
        {
            var actual = SystemTypeMapper.SystemTypeFor(new TypeName("DateTime"));

            Assert.That(actual, Is.EqualTo(typeof(DateTime)));
        }
예제 #6
0
        public void SystemTypeFor_ReferenceTypeString_ShouldMapToType()
        {
            var actual = SystemTypeMapper.SystemTypeFor(new StringReferenceType());

            Assert.That(actual, Is.EqualTo(typeof(string)));
        }
예제 #7
0
        public void SystemTypeFor_SimpleType_ShouldMapToType()
        {
            var actual = SystemTypeMapper.SystemTypeFor(new SimpleType(typeof(float)));

            Assert.That(actual, Is.EqualTo(typeof(float)));
        }
예제 #8
0
        public void SystemTypeFor_NullableTypeOfSimpleType_ShouldMapToType()
        {
            var actual = SystemTypeMapper.SystemTypeFor(new NullableType(new SimpleType(typeof(decimal))));

            Assert.That(actual, Is.EqualTo(typeof(decimal?)));
        }
예제 #9
0
        public void IsSystemType_NonSystemTypes_ShouldBeTrue()
        {
            var actual = SystemTypeMapper.IsSystemType(new TypeName("Foo.Bar.NotSystemType"));

            Assert.That(actual, Is.False);
        }