示例#1
0
        public void List()
        {
            var ints = AllPublicDescriber <List <int> > .Get();

            Assert.AreEqual(typeof(ListTypeDescription), ints.GetType());
            Assert.AreEqual(SimpleTypeDescription.Int, (ints as ListTypeDescription).Contains);

            var chars = AllPublicDescriber <char[]> .Get();

            Assert.AreEqual(typeof(ListTypeDescription), chars.GetType());
            Assert.AreEqual(SimpleTypeDescription.Char, (chars as ListTypeDescription).Contains);
        }
示例#2
0
        public void Dictionary()
        {
            var strToStr = AllPublicDescriber <Dictionary <string, string> > .Get();

            Assert.AreEqual(typeof(DictionaryTypeDescription), strToStr.GetType());
            Assert.AreEqual(SimpleTypeDescription.String, (strToStr as DictionaryTypeDescription).KeyType);
            Assert.AreEqual(SimpleTypeDescription.String, (strToStr as DictionaryTypeDescription).ValueType);

            var strToInt = AllPublicDescriber <Dictionary <string, int> > .Get();

            Assert.AreEqual(typeof(DictionaryTypeDescription), strToInt.GetType());
            Assert.AreEqual(SimpleTypeDescription.String, (strToInt as DictionaryTypeDescription).KeyType);
            Assert.AreEqual(SimpleTypeDescription.Int, (strToInt as DictionaryTypeDescription).ValueType);
        }
示例#3
0
        public void Class()
        {
            var c = AllPublicDescriber <Dummy> .Get();

            Assert.AreEqual(typeof(ClassTypeDescription), c.GetType());
            var asClass = c as ClassTypeDescription;

            Assert.AreEqual(3, asClass.Members.Count);
            Assert.IsTrue(asClass.Members.ContainsKey("Str"));
            Assert.IsTrue(asClass.Members.ContainsKey("Int"));
            Assert.IsTrue(asClass.Members.ContainsKey("Double"));

            Assert.AreEqual(SimpleTypeDescription.String, asClass.Members["Str"]);
            Assert.AreEqual(SimpleTypeDescription.Int, asClass.Members["Int"]);
            Assert.AreEqual(SimpleTypeDescription.Double, asClass.Members["Double"]);
        }
示例#4
0
 public void Simple()
 {
     Assert.AreEqual(SimpleTypeDescription.Long, AllPublicDescriber <long> .Get());
     Assert.AreEqual(SimpleTypeDescription.ULong, AllPublicDescriber <ulong> .Get());
     Assert.AreEqual(SimpleTypeDescription.Int, AllPublicDescriber <int> .Get());
     Assert.AreEqual(SimpleTypeDescription.UInt, AllPublicDescriber <uint> .Get());
     Assert.AreEqual(SimpleTypeDescription.Short, AllPublicDescriber <short> .Get());
     Assert.AreEqual(SimpleTypeDescription.UShort, AllPublicDescriber <ushort> .Get());
     Assert.AreEqual(SimpleTypeDescription.Byte, AllPublicDescriber <byte> .Get());
     Assert.AreEqual(SimpleTypeDescription.SByte, AllPublicDescriber <sbyte> .Get());
     Assert.AreEqual(SimpleTypeDescription.Char, AllPublicDescriber <char> .Get());
     Assert.AreEqual(SimpleTypeDescription.String, AllPublicDescriber <string> .Get());
     Assert.AreEqual(SimpleTypeDescription.Decimal, AllPublicDescriber <decimal> .Get());
     Assert.AreEqual(SimpleTypeDescription.Double, AllPublicDescriber <double> .Get());
     Assert.AreEqual(SimpleTypeDescription.Float, AllPublicDescriber <float> .Get());
 }