Example #1
0
        private void GivenCore(string name, string typeName, string value)
        {
            //Console.WriteLine($"***** Given:  name: {name}, type name: {typeName}, value: {value}");
            bool isNullValue = value == "null";

            ITypeProcessor processor = isNullValue
                ? _manager.GetProcessorForDataType(typeName) ?? new ObjectProcessor(_scenario)
                : _manager.GetProcessorFor(typeName, value);

            processor.PostCurrentValue(name);
            //Console.WriteLine($"***** Processor: {(processor != null ? processor.ToString() : "NULL")}");
        }
Example #2
0
        private void GivenCore(string name, string typeName, string value, string collectionKind)
        {
            //Console.WriteLine($"***** Given:  name: <{name}>, type name: <{typeName}>, value: <{value}>, collection: <{collectionKind}>");

            bool isNullValue = value == null || value == "null";

            if (isNullValue)
            {
                value = null;
            }

            ITypeProcessor processor = _manager.GetCollectionProcessorFor(collectionKind, typeName, value);

            processor.PostCurrentValue(name);

            //Console.WriteLine($"***** Processor: {(processor != null ? processor.ToString() : "NULL")}");
        }
Example #3
0
        private void GivenTypeOrKeyCore(string typeNameOrKey, string value)
        {
            //Console.WriteLine($"***** Given:  type or key: {typeNameOrKey}, value: {value}");
            bool           isNullValue = value == "null";
            ITypeProcessor processor   = null;

            if (isNullValue)
            {
                processor = _manager.GetProcessorForDataType(typeNameOrKey) ?? new ObjectProcessor(_scenario);
            }
            else
            {
                if (_manager.GetProcessorForDataType(typeNameOrKey, out processor))
                {
                    processor.PostValue(value);
                    return;
                }

                _manager.GetProcessorForValue(value, out processor);
            }

            processor.PostCurrentValue(typeNameOrKey);
            //Console.WriteLine($"***** Processor: {(processor != null ? processor.ToString() : "NULL")}");
        }