Пример #1
0
        public void Should_Get_Base_Selector_For_Primitive_Types()
        {
            //Create a new type table which uses all of the system defaults
            var table = new TypeTable();

            //Try to grab the integer selector...
            var intSelector = table.GetBaseSelector(typeof(int));

            Assert.IsInstanceOf <IntSelector>(intSelector);

            //Try to grab the float selector
            var floatSelector = table.GetBaseSelector(typeof(float));

            Assert.IsInstanceOf <FloatSelector>(floatSelector);

            //Try to grab the double selector
            var doubleSelector = table.GetBaseSelector(typeof(double));

            Assert.IsInstanceOf <DoubleSelector>(doubleSelector);

            //Try to grab the string selector
            var stringSelector = table.GetBaseSelector(typeof(string));

            Assert.IsInstanceOf <StringSelector>(stringSelector);

            //Try to grab the DateTime selector
            var dateTimeSelector = table.GetBaseSelector(typeof(DateTime));

            Assert.IsInstanceOf <DateTimeSelector>(dateTimeSelector);

            //Try to grab the Guid selector
            var guidSelector = table.GetBaseSelector(typeof(Guid));

            Assert.IsInstanceOf <GuidSelector>(guidSelector);
        }
Пример #2
0
        public void Should_Get_Base_Selector_For_Primitive_Types()
        {
            //Create a new type table which uses all of the system defaults
            var table = new TypeTable();

            //Try to grab the integer selector...
            var intSelector = table.GetBaseSelector(typeof (int));
            Assert.IsInstanceOf<IntSelector>(intSelector);

            //Try to grab the float selector
            var floatSelector = table.GetBaseSelector(typeof (float));
            Assert.IsInstanceOf<FloatSelector>(floatSelector);

            //Try to grab the double selector
            var doubleSelector = table.GetBaseSelector(typeof(double));
            Assert.IsInstanceOf<DoubleSelector>(doubleSelector);

            //Try to grab the string selector
            var stringSelector = table.GetBaseSelector(typeof(string));
            Assert.IsInstanceOf<StringSelector>(stringSelector);

            //Try to grab the DateTime selector
            var dateTimeSelector = table.GetBaseSelector(typeof(DateTime));
            Assert.IsInstanceOf<DateTimeSelector>(dateTimeSelector);

            //Try to grab the Guid selector
            var guidSelector = table.GetBaseSelector(typeof(Guid));
            Assert.IsInstanceOf<GuidSelector>(guidSelector);
        }