Example #1
0
        public void TypeSize_EnumTypeProvided_SizeReturned()
        {
            TestConverter converter = new TestConverter();

            int result = converter.TestTypeSize(typeof(StringComparison));

            Assert.AreEqual(sizeof(int), result);
        }
Example #2
0
        public void TypeSize_PrimitiveTypeNameProvided_SizeReturned()
        {
            TestConverter converter = new TestConverter();

            int result = converter.TestTypeSize(typeof(int).AssemblyQualifiedName);

            Assert.AreEqual(sizeof(int), result);
        }
Example #3
0
        public void TypeSize_DateTimeTypeProvided_SizeReturned()
        {
            TestConverter converter = new TestConverter();

            int result = converter.TestTypeSize(typeof(DateTime));

            Assert.AreEqual(sizeof(long), result);
        }
Example #4
0
        public void TypeSize_GuidTypeProvided_SizeReturned()
        {
            TestConverter converter = new TestConverter();

            int result = converter.TestTypeSize(typeof(Guid));

            Assert.AreEqual(16, result);
        }
Example #5
0
        public void TypeSize_UShortTypeProvided_SizeReturned()
        {
            TestConverter converter = new TestConverter();

            int result = converter.TestTypeSize(typeof(ushort));

            Assert.AreEqual(sizeof(ushort), result);
        }
Example #6
0
        public void TypeSize_DecimalTypeProvided_SizeReturned()
        {
            TestConverter converter = new TestConverter();

            int result = converter.TestTypeSize(typeof(decimal));

            Assert.AreEqual(sizeof(decimal), result);
        }
Example #7
0
        public void TypeSize_NullProvided_ZeroReturned()
        {
            TestConverter converter = new TestConverter();

            int result = converter.TestTypeSize(null as Type);

            Assert.AreEqual(0, result);
        }