/// <summary>
        ///   Determines the value of an object.
        /// </summary>
        /// <param name="reader">The XMLTextReader the read from.</param>
        /// <param name="converter">
        ///   The <see cref="System.Runtime.Serialization.FormatterConverter">converter</see> used to parse the values from the XML.
        /// </param>
        /// <param name="objectType">The type of the object to create.</param>
        /// <returns>The value of the object.</returns>
        private object DetermineValue(
            [NotNull] XmlTextReader reader,
            [NotNull] FormatterConverter converter,
            [NotNull] Type objectType)
        {
            object parsedObject;

            // check if the value can be directly determined or that the type is a complex type.
            if (objectType.IsPrimitive ||
                objectType == typeof(string) ||
                objectType.IsEnum ||
                objectType == typeof(DateTime) ||
                objectType == typeof(object))
            {
                // directly parse
                // ReSharper disable once AssignNullToNotNullAttribute
                parsedObject = converter.Convert(reader.ReadString(), objectType);
            }
            else
            {
                // Initialize the object (recursive call)
                parsedObject = InitializeObject(reader, converter, objectType);
            }

            return(parsedObject);
        }
Beispiel #2
0
        public ObjectState(SerializationInfo info, StreamingContext context)
        {
            IFormatterConverter converter = new FormatterConverter();

            foreach (SerializationEntry entry in info)
            {
                Data[entry.Name] = (byte[])converter.Convert(entry.Value, entry.ObjectType);
            }
        }
Beispiel #3
0
        /// <summary>
        /// Extends Convert so that methods that return a specific type object given a Type parameter can be
        /// used as generic method and casting is not required.
        /// <example>
        /// formatterconverter.Convert<int>(value);
        /// </example>
        /// </summary>
        public static T Convert <T>(this FormatterConverter formatterconverter, Object value)
        {
            if (formatterconverter == null)
            {
                throw new ArgumentNullException("formatterconverter");
            }

            return((T)formatterconverter.Convert(value, typeof(T)));
        }
Beispiel #4
0
        /// <summary>
        /// Converts the specified values.
        /// </summary>
        /// <param name="values">The values.</param>
        /// <returns>List&lt;T&gt;.</returns>
        public List <T> Convert(string[] values)
        {
            FormatterConverter converter = new FormatterConverter();
            List <T>           items     = new List <T>();

            foreach (var value in values)
            {
                items.Add((T)converter.Convert(value, typeof(T)));
            }
            return(items);
        }
        public void FormatterConverter_InvalidArguments_ThrowExceptions()
        {
            var f = new FormatterConverter();

            AssertExtensions.Throws <ArgumentNullException>("value", () => f.Convert(null, typeof(int)));
            AssertExtensions.Throws <ArgumentNullException>("value", () => f.Convert(null, TypeCode.Char));
            AssertExtensions.Throws <ArgumentNullException>("value", () => f.ToBoolean(null));
            AssertExtensions.Throws <ArgumentNullException>("value", () => f.ToByte(null));
            AssertExtensions.Throws <ArgumentNullException>("value", () => f.ToChar(null));
            AssertExtensions.Throws <ArgumentNullException>("value", () => f.ToDateTime(null));
            AssertExtensions.Throws <ArgumentNullException>("value", () => f.ToDecimal(null));
            AssertExtensions.Throws <ArgumentNullException>("value", () => f.ToDouble(null));
            AssertExtensions.Throws <ArgumentNullException>("value", () => f.ToInt16(null));
            AssertExtensions.Throws <ArgumentNullException>("value", () => f.ToInt32(null));
            AssertExtensions.Throws <ArgumentNullException>("value", () => f.ToInt64(null));
            AssertExtensions.Throws <ArgumentNullException>("value", () => f.ToSByte(null));
            AssertExtensions.Throws <ArgumentNullException>("value", () => f.ToSingle(null));
            AssertExtensions.Throws <ArgumentNullException>("value", () => f.ToString(null));
            AssertExtensions.Throws <ArgumentNullException>("value", () => f.ToUInt16(null));
            AssertExtensions.Throws <ArgumentNullException>("value", () => f.ToUInt32(null));
            AssertExtensions.Throws <ArgumentNullException>("value", () => f.ToUInt64(null));
        }
Beispiel #6
0
        /// <summary>
        /// Determines the value of an object.
        /// </summary>
        /// <param name="reader">The XML reader the read from.</param>
        /// <param name="converter">The converter used to parse the values from the XML.</param>
        /// <param name="objectType">The type of the object to create.</param>
        /// <returns>The value of the object.</returns>
        private object DetermineValue(XmlTextReader reader, FormatterConverter converter, Type objectType)
        {
            object parsedObject;

            // check if the value can be directly determined or that the type is a complex type.
            if (objectType.IsPrimitive || objectType == typeof(string) || objectType.IsEnum || objectType == typeof(DateTime) || objectType == typeof(object))
            {
                // directly parse
                parsedObject = converter.Convert(reader.ReadString(), objectType);
            }
            else
            {
                // Initialize the object (recursive call)
                parsedObject = InitializeObject(reader, converter, objectType);
            }

            return(parsedObject);
        }
Beispiel #7
0
        //Reads an object from the XML and initializes the object.
        private object InitializeObject(XmlTextReader reader, FormatterConverter converter)
        {
            Type actualType;
            int  id;

            //Check if a type or ref attribute is present
            if (!reader.HasAttributes)
            {
                throw new SerializationException("A non-primitive element was found without attributes.");
            }

            //Check for a ref attribute
            string reference = reader.GetAttribute("ref"); //, "http://www.w3.org/2001/XMLSchema-instance");

            //References require a previously deserialized object
            if (reference != null)
            {
                if (!int.TryParse(reference, out id))
                {
                    throw new SerializationException("Non numeric reference id found.");
                }

                object existing = null;
                if (!_idObjects.TryGetValue(id, out existing))
                {
                    throw new SerializationException(string.Format("An object reference with id {0} was not previously deserialized.", reference));
                }

                return(existing);
            }

            //Get the type name
            string actualTypeName = reader.GetAttribute("type"); // "http://www.w3.org/2001/XMLSchema-instance");

            actualType = Binder.BindToType("", actualTypeName);

            //Get the id attribute
            string objectId = reader.GetAttribute("id"); //, "http://www.w3.org/2001/XMLSchema-instance");

            //If the id is null then the object reference is null so return null
            if (objectId == null)
            {
                return(null);
            }

            //Convert to an integer value
            if (!int.TryParse(objectId, out id))
            {
                throw new SerializationException("An object id could not be converted to an integer value.");
            }

            ISurrogateSelector      selector1 = null;
            ISerializationSurrogate serializationSurrogate = null;
            SerializationInfo       info = null;

            if (SurrogateSelector == null)
            {
                throw new NullReferenceException("An error occurred deserializing an object. The SurrogateSelector property may not be null.");
            }
            serializationSurrogate = SurrogateSelector.GetSurrogate(actualType, Context, out selector1);
            if (serializationSurrogate == null)
            {
                throw new NullReferenceException(string.Format("An error occurred deserializing an object. A surrogate was not found for type {0}", actualType.Name));
            }

            //Use surrogate
            info = new SerializationInfo(actualType, converter);

            //Create a instance of the type, or use the existing object graph
            object initializedObject;

            if (Target == null)
            {
                initializedObject = FormatterServices.GetUninitializedObject(actualType);

                //Call the default constructor
                //Formatter could be expanded to use non default constructors at some later stage
                ConstructorInfo ci = actualType.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, System.Type.EmptyTypes, null);
                if (ci == null)
                {
                    throw new SerializationException(string.Format("Type {0} must implement a parameterless constructor.", actualType.FullName));
                }
                ci.Invoke(initializedObject, null);
            }
            else
            {
                initializedObject = Target;
                Target            = null; //Reset target so that it cannot be used recursively
            }

            //Add the object to the list of id objects
            _idObjects.Add(id, initializedObject);

            //Determine if a list or collection
            IDictionary dictionary = null;
            IList       list       = null;
            int         index      = 0;

            //Read the first element
            reader.ReadStartElement();

            while (reader.IsStartElement())
            {
                //Determine type
                string typeName  = reader.GetAttribute("type"); //, "http://www.w3.org/2001/XMLSchema-instance");
                Type   childType = Binder.BindToType("", typeName);

                //Get a key, if any
                string key = reader.GetAttribute("key");

                //Check for a uri attribute
                string uri = reader.GetAttribute("uri");

                //Check if a collection
                if (reader.Name == "Collection" && reader.IsStartElement())
                {
                    if (typeName == "IDictionary")
                    {
                        dictionary = initializedObject as IDictionary;
                        list       = null;
                    }
                    else if (typeName == "IList")
                    {
                        list       = initializedObject as IList;
                        dictionary = null;
                    }

                    reader.ReadStartElement();
                }
                //Check for a resource entry
                else if (uri != null)
                {
                    //Uris require a resource preloaded in the _resources collection
                    ResourceEntry resourceEntry;
                    if (!_resources.TryGetValue(uri, out resourceEntry))
                    {
                        throw new SerializationException(string.Format("A resource with uri {0} was not found in the resources collection.", uri));
                    }

                    info.AddValue(resourceEntry.Name, resourceEntry.Value);

                    reader.Read();
                }
                //Process all other elements
                else
                {
                    object parsedObject = null;

                    //Check if the value can be directly determined or that the type is a complex type.
                    if (childType.IsPrimitive || childType == typeof(string) || childType.IsEnum || childType == typeof(DateTime) || childType == typeof(object))
                    {
                        //Directly parse
                        parsedObject = converter.Convert(reader.ReadString(), childType);
                    }
                    else
                    {
                        //Recurse down the object graph
                        parsedObject = InitializeObject(reader, converter);
                    }

                    //Add to parent collection or add the key value pair to the info object for the serialization surrogate to use
                    if (dictionary != null && key != null)
                    {
                        dictionary.Add(key, parsedObject);
                    }
                    else if (list != null)
                    {
                        list.Add(parsedObject);
                    }
                    else
                    {
                        info.AddValue(reader.Name, parsedObject); //Use info object
                    }

                    //Move to next element
                    reader.Read();

                    //Read past collection
                    if (reader.Name == "Collection" && !reader.IsStartElement())
                    {
                        reader.Read();
                    }
                }
            }

            //Use the surrogate to populate the instance
            initializedObject = serializationSurrogate.SetObjectData(initializedObject, info, Context, SurrogateSelector);

            return(initializedObject);
        }
Beispiel #8
0
        public static object ConvertPOD <T>(byte[] buf)
        {
            //Marshal.Copy( buf, 0, ptr, buf.Length );

            /*
             * Type[] args = new Type[] { typeof(T) };
             *
             * var cons = typeof(T).GetConstructor( args );
             *
             * //cons.Invoke()
             *
             *
             * Convert.ToBoolean(buf)
             */

            TypeCode code = Type.GetTypeCode(typeof(T));


            switch (code)
            {
            case TypeCode.Empty:
                break;

            case TypeCode.Object:
                break;

            case TypeCode.DBNull:
                break;

            case TypeCode.Boolean:
            {
                var t = BitConverter.ToBoolean(buf);
                return(s_conv.Convert(t, typeof(T)));
            }

            case TypeCode.Char:
            {
                var t = BitConverter.ToChar(buf);
                return(s_conv.Convert(t, typeof(T)));
            }

            case TypeCode.SByte:
            {
                var t = BitConverter.ToChar(buf);
                return(s_conv.Convert(t, typeof(T)));
            }

            case TypeCode.Byte:
            {
                var t = buf[0];
                return(s_conv.Convert(t, typeof(T)));
            }

            case TypeCode.Int16:
            {
                var t = BitConverter.ToChar(buf);
                return(s_conv.Convert(t, typeof(T)));
            }

            case TypeCode.UInt16:
            {
                var t = BitConverter.ToUInt16(buf);
                return(s_conv.Convert(t, typeof(T)));
            }

            case TypeCode.Int32:
            {
                var t = BitConverter.ToInt32(buf);
                return(s_conv.Convert(t, typeof(T)));
            }

            case TypeCode.UInt32:
            {
                var t = BitConverter.ToUInt32(buf);
                return(s_conv.Convert(t, typeof(T)));
            }

            case TypeCode.Int64:
            {
                var t = BitConverter.ToInt64(buf);
                return(s_conv.Convert(t, typeof(T)));
            }

            case TypeCode.UInt64:
            {
                var t = BitConverter.ToUInt64(buf);
                return(s_conv.Convert(t, typeof(T)));
            }

            case TypeCode.Single:
            {
                var t = BitConverter.ToSingle(buf);
                return(s_conv.Convert(t, typeof(T)));
            }

            case TypeCode.Double:
            {
                var t = BitConverter.ToDouble(buf);
                return(s_conv.Convert(t, typeof(T)));
            }

                /*
                 * case TypeCode.Decimal:
                 * break;
                 *
                 * case TypeCode.DateTime:
                 * break;
                 *
                 * case TypeCode.String:
                 * break;
                 */
            }

            return(new object());
        }
Beispiel #9
0
        /// <summary>
        /// Converts the specified value.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns>T.</returns>
        public T Convert(string value)
        {
            FormatterConverter converter = new FormatterConverter();

            return((T)converter.Convert(value, typeof(T)));
        }
	public bool runTest()
	{
		Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer);
		int iCountErrors = 0;
		int iCountTestcases = 0;
		String strLoc = "Loc_000oo";
		FormatterConverter fmtcnv1 = null;
		Boolean fValue;
		Char chValue;
		SByte sbtValue;
		Byte btValue;
		Int16 i16Value;
		Int32 i32Value;
		Int64 i64Value;
		UInt16 ui16Value;
		UInt32 ui32Value;
		UInt64 ui64Value;
		Double dblValue;
		Single sglValue;
		DateTime dtValue;
		Decimal dcValue;
		Object oValue;
		Object oRtnValue;
		String strValue;
		TypeCode tpcd1;
		Object[] oTpCodeArr;
		TypeCode[] arrTpCodeArr;
		Object[] oArr = {false, (SByte)5, (Byte)5, (Int16)5, (Int32)5, (Int64)5,
		(UInt16)5, (UInt32)5, (UInt64)5, (Single)5.0, (Double)5.0, };
		Type[] tpArr  = {typeof(Boolean), typeof(SByte), typeof(Byte), typeof(Int16), typeof(Int32),
			typeof(Int64), typeof(UInt16), typeof(UInt32), typeof(UInt64), typeof(Single),
		typeof(Double), };
		try {
			do
			{
				strLoc="Loc_6573cd";
				fmtcnv1 = new FormatterConverter();
				strValue = "false";
				fValue = false;
				iCountTestcases++;
				if(fmtcnv1.ToBoolean(strValue) != fValue)
				{
					iCountErrors++;
					Console.WriteLine("Err_0246sd! Wrong value returned, " + fmtcnv1.ToBoolean(strValue));
				}
				i32Value = 5;
				fValue = true;
				iCountTestcases++;
				if(fmtcnv1.ToBoolean(i32Value) != fValue)
				{
					iCountErrors++;
					Console.WriteLine("Err_87430cd! Wrong value returned, " + fmtcnv1.ToBoolean(i32Value));
				}
				try {
					iCountTestcases++;
					strValue = "Hey man";
					fmtcnv1.ToBoolean(strValue);
					iCountErrors++;
					Console.WriteLine("Err_1065753cd! Exception not thrown");
					}catch(FormatException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_5739cd! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					fmtcnv1.ToBoolean(null);
					iCountErrors++;
					Console.WriteLine("Err_84532fd! Exception not thrown");
					}catch(ArgumentNullException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
				}
				i32Value = 5;
				btValue = 5;
				iCountTestcases++;
				if(fmtcnv1.ToByte(i32Value) != btValue)
				{
					iCountErrors++;
					Console.WriteLine("Err_0753cfd! Wrong value returned, " + fmtcnv1.ToByte(i32Value));
				}
				strValue = "5";
				btValue = 5;
				iCountTestcases++;
				if(fmtcnv1.ToByte(strValue) != btValue)
				{
					iCountErrors++;
					Console.WriteLine("Err_0483fd! Wrong value returned, " + fmtcnv1.ToByte(strValue));
				}
				try {
					iCountTestcases++;
					strValue = "Hey man";
					fmtcnv1.ToByte(strValue);
					iCountErrors++;
					Console.WriteLine("Err_034752fsd! Exception not thrown");
					}catch(FormatException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_04729cd! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					i32Value = 743290;
					fmtcnv1.ToByte(i32Value);
					iCountErrors++;
					Console.WriteLine("Err_047239fd! Exception not thrown");
					}catch(OverflowException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_017s! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					fmtcnv1.ToByte(null);
					iCountErrors++;
					Console.WriteLine("Err_84532fd! Exception not thrown");
					}catch(ArgumentNullException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
				}
				i32Value = 5;
				chValue = (Char)5;
				iCountTestcases++;
				if(fmtcnv1.ToChar(i32Value)!=chValue)
				{
					iCountErrors++;
					Console.WriteLine("Err_8475320vdef! Wrong value returned, " + fmtcnv1.ToChar(i32Value));
				}
				strValue = "5";
				chValue = (Char)53;
				iCountTestcases++;
				if(fmtcnv1.ToChar(strValue)!=chValue)
				{
					iCountErrors++;
					Console.WriteLine("Err_01237xs! Wrong value returned, " + fmtcnv1.ToChar(strValue) + " " + chValue);
				}
				try {
					iCountTestcases++;
					strValue = "Hey man";
					fmtcnv1.ToChar(strValue);
					iCountErrors++;
					Console.WriteLine("Err_048329fde! Exception not thrown");
					}catch(FormatException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1093cd! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					i32Value = 743290;
					fmtcnv1.ToChar(i32Value);
					iCountErrors++;
					Console.WriteLine("Err_0483vfd! Exception not thrown");
					}catch(OverflowException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_017s! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					fmtcnv1.ToChar(null);
					iCountErrors++;
					Console.WriteLine("Err_84532fd! Exception not thrown");
					}catch(ArgumentNullException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
				}
				strLoc="Loc_34732fd";
				dtValue = DateTime.Now;
				strValue = dtValue.ToString();
				iCountTestcases++;
				if(!fmtcnv1.ToDateTime(strValue).ToString().Equals(dtValue.ToString()))
				{
					iCountErrors++;
					Console.WriteLine("Err_0278423d! Wrong value returned, " + fmtcnv1.ToDateTime(strValue) + " " + dtValue);
				}
				strLoc="Loc_047gd";
				try {
					iCountTestcases++;
					strValue = "Hey man";
					fmtcnv1.ToDateTime(strValue);
					iCountErrors++;
					Console.WriteLine("Err_34234dsf! Exception not thrown");
					}catch(FormatException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_dfsdfsfsng exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					i32Value = 743290;
					fmtcnv1.ToByte(i32Value);
					iCountErrors++;
					Console.WriteLine("Err_0453fd! Exception not thrown");
					}catch(OverflowException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_10084523f! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					fmtcnv1.ToByte(null);
					iCountErrors++;
					Console.WriteLine("Err_84532fd! Exception not thrown");
					}catch(ArgumentNullException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
				}
				strLoc="Loc_44732fd";
				dcValue = (Decimal)123.23;
				strValue = "123.23";
				if (!dcValue.ToString().Equals(strValue))
					throw new Exception("Decimal ToString doesn't match expected value!  Decimal: "+dcValue.ToString());
				iCountTestcases++;
				if(fmtcnv1.ToDecimal(strValue)!=dcValue)
				{
					iCountErrors++;
					Console.WriteLine("Err_342fsd! Wrong value returned, " + fmtcnv1.ToDecimal(strValue) );
				}
				strLoc="Loc_047gd";
				try {
					iCountTestcases++;
					strValue = "Hey man";
					fmtcnv1.ToDecimal(strValue);
					iCountErrors++;
					Console.WriteLine("Err_342dfs! Exception not thrown");
					}catch(FormatException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_8342vds exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					dblValue = Double.MaxValue;
					fmtcnv1.ToDecimal(dblValue);
					iCountErrors++;
					Console.WriteLine("Err_1091212dsdas! Exception not thrown");
					}catch(OverflowException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_10874cd! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					fmtcnv1.ToDecimal(null);
					iCountErrors++;
					Console.WriteLine("Err_84532fd! Exception not thrown");
					}catch(ArgumentNullException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
				}
				strLoc="Loc_24732fd";
				dblValue = 123.23;
				strValue = "123.23";
				iCountTestcases++;
				if(fmtcnv1.ToDouble(strValue)!=dblValue)
				{
					iCountErrors++;
					Console.WriteLine("Err_10742cd! Wrong value returned, " + fmtcnv1.ToDouble(strValue) );
				}
				strLoc="Loc_047gd";
				try {
					iCountTestcases++;
					strValue = "Hey man";
					fmtcnv1.ToDouble(strValue);
					iCountErrors++;
					Console.WriteLine("Err_197wc! Exception not thrown");
					}catch(FormatException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1087wxs exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					fValue = true;
					Double d = fmtcnv1.ToDouble(fValue);
                                        if ( d != 1 )
                                        {
					        iCountErrors++;
					        Console.WriteLine("FormatConvertor.ToDouble method returns unexpected value." + d);
                                        }        
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_02834cd! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					fmtcnv1.ToDouble(null);
					iCountErrors++;
					Console.WriteLine("Err_84532fd! Exception not thrown");
					}catch(ArgumentNullException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
				}
				i32Value = 5;
				i16Value = 5;
				iCountTestcases++;
				if(fmtcnv1.ToInt16(i32Value) != i16Value)
				{
					iCountErrors++;
					Console.WriteLine("Err_045fdc! Wrong value returned, " + fmtcnv1.ToInt16(i32Value));
				}
				strValue = "5";
				i16Value = 5;
				iCountTestcases++;
				if(fmtcnv1.ToInt16(strValue) != i16Value)
				{
					iCountErrors++;
					Console.WriteLine("Err_04523vdf! Wrong value returned, " + fmtcnv1.ToInt16(strValue));
				}
				try {
					iCountTestcases++;
					strValue = "Hey man";
					fmtcnv1.ToInt16(strValue);
					iCountErrors++;
					Console.WriteLine("Err_134782ds! Exception not thrown");
					}catch(FormatException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_107342dcs! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					i32Value = Int32.MaxValue;
					fmtcnv1.ToInt16(i32Value);
					iCountErrors++;
					Console.WriteLine("Err_93742cvsd! Exception not thrown");
					}catch(OverflowException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_0134vsdf! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					fmtcnv1.ToInt16(null);
					iCountErrors++;
					Console.WriteLine("Err_84532fd! Exception not thrown");
					}catch(ArgumentNullException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
				}
				i32Value = 5;
				i64Value = 5;
				iCountTestcases++;
				if(fmtcnv1.ToInt32(i64Value) != i32Value)
				{
					iCountErrors++;
					Console.WriteLine("Err_0753cfd! Wrong value returned, " + fmtcnv1.ToInt32(i64Value));
				}
				strValue = "5";
				i32Value = 5;
				iCountTestcases++;
				if(fmtcnv1.ToInt32(strValue) != i32Value)
				{
					iCountErrors++;
					Console.WriteLine("Err_197axs! Wrong value returned, " + fmtcnv1.ToInt32(strValue));
				}
				try {
					iCountTestcases++;
					strValue = "Hey man";
					fmtcnv1.ToInt32(strValue);
					iCountErrors++;
					Console.WriteLine("Err_1112s! Exception not thrown");
					}catch(FormatException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_dasda213! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					i64Value = Int64.MaxValue;
					fmtcnv1.ToInt32(i64Value);
					iCountErrors++;
					Console.WriteLine("Err_2423cds! Exception not thrown");
					}catch(OverflowException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_0231das! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					fmtcnv1.ToInt32(null);
					iCountErrors++;
					Console.WriteLine("Err_84532fd! Exception not thrown");
					}catch(ArgumentNullException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
				}
				i32Value = 5;
				i64Value = 5;
				iCountTestcases++;
				if(fmtcnv1.ToInt64(i32Value) != i64Value)
				{
					iCountErrors++;
					Console.WriteLine("Err_452cds! Wrong value returned, " + fmtcnv1.ToInt64(i32Value));
				}
				strValue = "5";
				i64Value = 5;
				iCountTestcases++;
				if(fmtcnv1.ToInt64(strValue) != i64Value)
				{
					iCountErrors++;
					Console.WriteLine("Err_234dcd! Wrong value returned, " + fmtcnv1.ToInt64(strValue));
				}
				try {
					iCountTestcases++;
					strValue = "Hey man";
					fmtcnv1.ToInt64(strValue);
					iCountErrors++;
					Console.WriteLine("Err_134! Exception not thrown");
					}catch(FormatException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_fdvw! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					dblValue = Double.MaxValue;
					fmtcnv1.ToInt64(dblValue);
					iCountErrors++;
					Console.WriteLine("Err_23084ds! Exception not thrown");
					}catch(OverflowException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1084d! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					fmtcnv1.ToInt64(null);
					iCountErrors++;
					Console.WriteLine("Err_84532fd! Exception not thrown");
					}catch(ArgumentNullException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
				}
				i32Value = 5;
				sbtValue = 5;
				iCountTestcases++;
				if(fmtcnv1.ToSByte(i32Value) != sbtValue)
				{
					iCountErrors++;
					Console.WriteLine("Err_013248csd! Wrong value returned, " + fmtcnv1.ToSByte(i32Value));
				}
				strValue = "5";
				sbtValue = 5;
				iCountTestcases++;
				if(fmtcnv1.ToSByte(strValue) != sbtValue)
				{
					iCountErrors++;
					Console.WriteLine("Err_10732sx! Wrong value returned, " + fmtcnv1.ToSByte(strValue));
				}
				try {
					iCountTestcases++;
					strValue = "Hey man";
					fmtcnv1.ToSByte(strValue);
					iCountErrors++;
					Console.WriteLine("Err_632sa! Exception not thrown");
					}catch(FormatException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_6732ds! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					i32Value = 743290;
					fmtcnv1.ToSByte(i32Value);
					iCountErrors++;
					Console.WriteLine("Err_003sw! Exception not thrown");
					}catch(OverflowException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_13853ds! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					fmtcnv1.ToSByte(null);
					iCountErrors++;
					Console.WriteLine("Err_84532fd! Exception not thrown");
					}catch(ArgumentNullException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
				}
				i32Value = 5;
				sglValue = 5.0f;
				iCountTestcases++;
				if(fmtcnv1.ToSingle(i32Value) != sglValue)
				{
					iCountErrors++;
					Console.WriteLine("Err_0527fds! Wrong value returned, " + fmtcnv1.ToSingle(i32Value));
				}
				strValue = "5";
				sglValue = 5;
				iCountTestcases++;
				if(fmtcnv1.ToSingle(strValue) != sglValue)
				{
					iCountErrors++;
					Console.WriteLine("Err_842fsd! Wrong value returned, " + fmtcnv1.ToSingle(strValue));
				}
				try {
					iCountTestcases++;
					strValue = "Hey man";
					fmtcnv1.ToSingle(strValue);
					iCountErrors++;
					Console.WriteLine("Err_3421da! Exception not thrown");
					}catch(FormatException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_34123! Wrong exception thrown, " + ex);
				}
				dblValue = Double.MaxValue;
				sglValue = Single.PositiveInfinity;
				iCountTestcases++;
				if(fmtcnv1.ToSingle(dblValue) != sglValue)
				{
					iCountErrors++;
					Console.WriteLine("Err_2231dfs! Wrong value returned, " + fmtcnv1.ToSingle(dblValue));
				}
				try {
					iCountTestcases++;
					fmtcnv1.ToSingle(null);
					iCountErrors++;
					Console.WriteLine("Err_84532fd! Exception not thrown");
					}catch(ArgumentNullException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
				}
				i32Value = 5;
				strValue = "5";
				iCountTestcases++;
				if(!strValue.Equals(fmtcnv1.ToString(i32Value)))
				{
					iCountErrors++;
					Console.WriteLine("Err_93472fsd! Wrong value returned, " + fmtcnv1.ToString(i32Value));
				}
				try {
					iCountTestcases++;
					fmtcnv1.ToString(null);
					iCountErrors++;
					Console.WriteLine("Err_84532fd! Exception not thrown");
					}catch(ArgumentNullException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
				}
				i32Value = 5;
				ui16Value = 5;
				iCountTestcases++;
				if(fmtcnv1.ToUInt16(i32Value) != ui16Value)
				{
					iCountErrors++;
					Console.WriteLine("Err_045fvd! Wrong value returned, " + fmtcnv1.ToUInt16(i32Value));
				}
				strValue = "5";
				ui16Value = 5;
				iCountTestcases++;
				if(fmtcnv1.ToUInt16(strValue) != ui16Value)
				{
					iCountErrors++;
					Console.WriteLine("Err_1834dcvds! Wrong value returned, " + fmtcnv1.ToUInt16(strValue));
				}
				try {
					iCountTestcases++;
					strValue = "Hey man";
					fmtcnv1.ToUInt16(strValue);
					iCountErrors++;
					Console.WriteLine("Err_183cs! Exception not thrown");
					}catch(FormatException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_189ws! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					i32Value = Int32.MaxValue;
					fmtcnv1.ToUInt16(i32Value);
					iCountErrors++;
					Console.WriteLine("Err_342fds! Exception not thrown");
					}catch(OverflowException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_6454cd! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					fmtcnv1.ToUInt16(null);
					iCountErrors++;
					Console.WriteLine("Err_84532fd! Exception not thrown");
					}catch(ArgumentNullException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
				}
				i32Value = 5;
				ui32Value = 5;
				iCountTestcases++;
				if(fmtcnv1.ToUInt32(i64Value) != ui32Value)
				{
					iCountErrors++;
					Console.WriteLine("Err_7834vfd! Wrong value returned, " + fmtcnv1.ToUInt32(i64Value));
				}
				strValue = "5";
				ui32Value = 5;
				iCountTestcases++;
				if(fmtcnv1.ToUInt32(strValue) != ui32Value)
				{
					iCountErrors++;
					Console.WriteLine("Err_1243vcd! Wrong value returned, " + fmtcnv1.ToUInt32(strValue));
				}
				try {
					iCountTestcases++;
					strValue = "Hey man";
					fmtcnv1.ToUInt32(strValue);
					iCountErrors++;
					Console.WriteLine("Err_1234csx! Exception not thrown");
					}catch(FormatException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_5634fsd! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					i64Value = Int64.MaxValue;
					fmtcnv1.ToUInt32(i64Value);
					iCountErrors++;
					Console.WriteLine("Err_0453vdf! Exception not thrown");
					}catch(OverflowException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_0342vfdf! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					fmtcnv1.ToUInt32(null);
					iCountErrors++;
					Console.WriteLine("Err_84532fd! Exception not thrown");
					}catch(ArgumentNullException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
				}
				i32Value = 5;
				ui64Value = 5;
				iCountTestcases++;
				if(fmtcnv1.ToUInt64(i32Value) != ui64Value)
				{
					iCountErrors++;
					Console.WriteLine("Err_38503dc! Wrong value returned, " + fmtcnv1.ToUInt64(i32Value));
				}
				strValue = "5";
				ui64Value = 5;
				iCountTestcases++;
				if(fmtcnv1.ToUInt64(strValue) != ui64Value)
				{
					iCountErrors++;
					Console.WriteLine("Err_0173xs! Wrong value returned, " + fmtcnv1.ToUInt64(strValue));
				}
				try {
					iCountTestcases++;
					strValue = "Hey man";
					fmtcnv1.ToUInt64(strValue);
					iCountErrors++;
					Console.WriteLine("Err_013csd! Exception not thrown");
					}catch(FormatException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_75421xs! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					dblValue = Double.MaxValue;
					fmtcnv1.ToUInt64(dblValue);
					iCountErrors++;
					Console.WriteLine("Err_3472ds! Exception not thrown");
					}catch(OverflowException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_vefe! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					fmtcnv1.ToUInt64(null);
					iCountErrors++;
					Console.WriteLine("Err_84532fd! Exception not thrown");
					}catch(ArgumentNullException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
				}
				iCountTestcases++;
				for(int i=0;i<oArr.Length; i++){
					oValue = oArr[i];
					for(int j=0;j<tpArr.Length; j++){
						try{
							oRtnValue = fmtcnv1.Convert(oValue, tpArr[j]);
							}catch(Exception ex){
							if(ex.ToString().IndexOf("InvalidCastException")==-1)
							Console.WriteLine(i + " " + j + " " + ex);
						}
					}
				}
				iCountTestcases++;
				arrTpCodeArr = (TypeCode[])Enum.GetValues(typeof(TypeCode));
				for(int i=0;i<oArr.Length; i++){
					oValue = oArr[i];
					for(int j=0;j<arrTpCodeArr.Length; j++){
						tpcd1 = arrTpCodeArr[j];
						try{
							oRtnValue = fmtcnv1.Convert(oValue, tpcd1);
							}catch(Exception ex){
							if(ex.ToString().IndexOf("InvalidCastException")==-1)
							Console.WriteLine(i + " " + j + " " + ex);
						}
					}
				}
			} while (false);
			} catch (Exception exc_general ) {
			++iCountErrors;
			Console.WriteLine (s_strTFAbbrev + " : Error Err_8888yyy!  strLoc=="+ strLoc +", exc_general==\n"+exc_general);
		}
		if ( iCountErrors == 0 )
		{
			Console.WriteLine( "paSs.   "+s_strTFPath +" "+s_strTFName+" ,iCountTestcases=="+iCountTestcases.ToString());
			return true;
		}
		else
		{
			Console.WriteLine("FAiL!   "+s_strTFPath+" "+s_strTFName+" ,iCountErrors=="+iCountErrors.ToString()+" , BugNums?: "+s_strActiveBugNums );
			return false;
		}
	}
    public bool runTest()
    {
        Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer);
        int                iCountErrors    = 0;
        int                iCountTestcases = 0;
        String             strLoc          = "Loc_000oo";
        FormatterConverter fmtcnv1         = null;
        Boolean            fValue;
        Char               chValue;
        SByte              sbtValue;
        Byte               btValue;
        Int16              i16Value;
        Int32              i32Value;
        Int64              i64Value;
        UInt16             ui16Value;
        UInt32             ui32Value;
        UInt64             ui64Value;
        Double             dblValue;
        Single             sglValue;
        DateTime           dtValue;
        Decimal            dcValue;
        Object             oValue;
        Object             oRtnValue;
        String             strValue;
        TypeCode           tpcd1;

        Object[]   oTpCodeArr;
        TypeCode[] arrTpCodeArr;
        Object[]   oArr = { false,   (SByte)5,  (Byte)5,   (Int16)5,    (Int32)5,    (Int64)5,
                            (UInt16)5, (UInt32)5, (UInt64)5, (Single)5.0, (Double)5.0, };
        Type[]     tpArr = { typeof(Boolean), typeof(SByte),  typeof(Byte),   typeof(Int16),  typeof(Int32),
                             typeof(Int64),       typeof(UInt16), typeof(UInt32), typeof(UInt64), typeof(Single),
                             typeof(Double),      };
        try {
            do
            {
                strLoc   = "Loc_6573cd";
                fmtcnv1  = new FormatterConverter();
                strValue = "false";
                fValue   = false;
                iCountTestcases++;
                if (fmtcnv1.ToBoolean(strValue) != fValue)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_0246sd! Wrong value returned, " + fmtcnv1.ToBoolean(strValue));
                }
                i32Value = 5;
                fValue   = true;
                iCountTestcases++;
                if (fmtcnv1.ToBoolean(i32Value) != fValue)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_87430cd! Wrong value returned, " + fmtcnv1.ToBoolean(i32Value));
                }
                try {
                    iCountTestcases++;
                    strValue = "Hey man";
                    fmtcnv1.ToBoolean(strValue);
                    iCountErrors++;
                    Console.WriteLine("Err_1065753cd! Exception not thrown");
                }catch (FormatException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_5739cd! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    fmtcnv1.ToBoolean(null);
                    iCountErrors++;
                    Console.WriteLine("Err_84532fd! Exception not thrown");
                }catch (ArgumentNullException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
                }
                i32Value = 5;
                btValue  = 5;
                iCountTestcases++;
                if (fmtcnv1.ToByte(i32Value) != btValue)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_0753cfd! Wrong value returned, " + fmtcnv1.ToByte(i32Value));
                }
                strValue = "5";
                btValue  = 5;
                iCountTestcases++;
                if (fmtcnv1.ToByte(strValue) != btValue)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_0483fd! Wrong value returned, " + fmtcnv1.ToByte(strValue));
                }
                try {
                    iCountTestcases++;
                    strValue = "Hey man";
                    fmtcnv1.ToByte(strValue);
                    iCountErrors++;
                    Console.WriteLine("Err_034752fsd! Exception not thrown");
                }catch (FormatException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_04729cd! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    i32Value = 743290;
                    fmtcnv1.ToByte(i32Value);
                    iCountErrors++;
                    Console.WriteLine("Err_047239fd! Exception not thrown");
                }catch (OverflowException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_017s! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    fmtcnv1.ToByte(null);
                    iCountErrors++;
                    Console.WriteLine("Err_84532fd! Exception not thrown");
                }catch (ArgumentNullException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
                }
                i32Value = 5;
                chValue  = (Char)5;
                iCountTestcases++;
                if (fmtcnv1.ToChar(i32Value) != chValue)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_8475320vdef! Wrong value returned, " + fmtcnv1.ToChar(i32Value));
                }
                strValue = "5";
                chValue  = (Char)53;
                iCountTestcases++;
                if (fmtcnv1.ToChar(strValue) != chValue)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_01237xs! Wrong value returned, " + fmtcnv1.ToChar(strValue) + " " + chValue);
                }
                try {
                    iCountTestcases++;
                    strValue = "Hey man";
                    fmtcnv1.ToChar(strValue);
                    iCountErrors++;
                    Console.WriteLine("Err_048329fde! Exception not thrown");
                }catch (FormatException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1093cd! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    i32Value = 743290;
                    fmtcnv1.ToChar(i32Value);
                    iCountErrors++;
                    Console.WriteLine("Err_0483vfd! Exception not thrown");
                }catch (OverflowException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_017s! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    fmtcnv1.ToChar(null);
                    iCountErrors++;
                    Console.WriteLine("Err_84532fd! Exception not thrown");
                }catch (ArgumentNullException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
                }
                strLoc   = "Loc_34732fd";
                dtValue  = DateTime.Now;
                strValue = dtValue.ToString();
                iCountTestcases++;
                if (!fmtcnv1.ToDateTime(strValue).ToString().Equals(dtValue.ToString()))
                {
                    iCountErrors++;
                    Console.WriteLine("Err_0278423d! Wrong value returned, " + fmtcnv1.ToDateTime(strValue) + " " + dtValue);
                }
                strLoc = "Loc_047gd";
                try {
                    iCountTestcases++;
                    strValue = "Hey man";
                    fmtcnv1.ToDateTime(strValue);
                    iCountErrors++;
                    Console.WriteLine("Err_34234dsf! Exception not thrown");
                }catch (FormatException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_dfsdfsfsng exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    i32Value = 743290;
                    fmtcnv1.ToByte(i32Value);
                    iCountErrors++;
                    Console.WriteLine("Err_0453fd! Exception not thrown");
                }catch (OverflowException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_10084523f! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    fmtcnv1.ToByte(null);
                    iCountErrors++;
                    Console.WriteLine("Err_84532fd! Exception not thrown");
                }catch (ArgumentNullException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
                }
                strLoc   = "Loc_44732fd";
                dcValue  = (Decimal)123.23;
                strValue = "123.23";
                if (!dcValue.ToString().Equals(strValue))
                {
                    throw new Exception("Decimal ToString doesn't match expected value!  Decimal: " + dcValue.ToString());
                }
                iCountTestcases++;
                if (fmtcnv1.ToDecimal(strValue) != dcValue)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_342fsd! Wrong value returned, " + fmtcnv1.ToDecimal(strValue));
                }
                strLoc = "Loc_047gd";
                try {
                    iCountTestcases++;
                    strValue = "Hey man";
                    fmtcnv1.ToDecimal(strValue);
                    iCountErrors++;
                    Console.WriteLine("Err_342dfs! Exception not thrown");
                }catch (FormatException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_8342vds exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    dblValue = Double.MaxValue;
                    fmtcnv1.ToDecimal(dblValue);
                    iCountErrors++;
                    Console.WriteLine("Err_1091212dsdas! Exception not thrown");
                }catch (OverflowException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_10874cd! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    fmtcnv1.ToDecimal(null);
                    iCountErrors++;
                    Console.WriteLine("Err_84532fd! Exception not thrown");
                }catch (ArgumentNullException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
                }
                strLoc   = "Loc_24732fd";
                dblValue = 123.23;
                strValue = "123.23";
                iCountTestcases++;
                if (fmtcnv1.ToDouble(strValue) != dblValue)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_10742cd! Wrong value returned, " + fmtcnv1.ToDouble(strValue));
                }
                strLoc = "Loc_047gd";
                try {
                    iCountTestcases++;
                    strValue = "Hey man";
                    fmtcnv1.ToDouble(strValue);
                    iCountErrors++;
                    Console.WriteLine("Err_197wc! Exception not thrown");
                }catch (FormatException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1087wxs exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    fValue = true;
                    Double d = fmtcnv1.ToDouble(fValue);
                    if (d != 1)
                    {
                        iCountErrors++;
                        Console.WriteLine("FormatConvertor.ToDouble method returns unexpected value." + d);
                    }
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_02834cd! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    fmtcnv1.ToDouble(null);
                    iCountErrors++;
                    Console.WriteLine("Err_84532fd! Exception not thrown");
                }catch (ArgumentNullException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
                }
                i32Value = 5;
                i16Value = 5;
                iCountTestcases++;
                if (fmtcnv1.ToInt16(i32Value) != i16Value)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_045fdc! Wrong value returned, " + fmtcnv1.ToInt16(i32Value));
                }
                strValue = "5";
                i16Value = 5;
                iCountTestcases++;
                if (fmtcnv1.ToInt16(strValue) != i16Value)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_04523vdf! Wrong value returned, " + fmtcnv1.ToInt16(strValue));
                }
                try {
                    iCountTestcases++;
                    strValue = "Hey man";
                    fmtcnv1.ToInt16(strValue);
                    iCountErrors++;
                    Console.WriteLine("Err_134782ds! Exception not thrown");
                }catch (FormatException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_107342dcs! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    i32Value = Int32.MaxValue;
                    fmtcnv1.ToInt16(i32Value);
                    iCountErrors++;
                    Console.WriteLine("Err_93742cvsd! Exception not thrown");
                }catch (OverflowException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_0134vsdf! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    fmtcnv1.ToInt16(null);
                    iCountErrors++;
                    Console.WriteLine("Err_84532fd! Exception not thrown");
                }catch (ArgumentNullException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
                }
                i32Value = 5;
                i64Value = 5;
                iCountTestcases++;
                if (fmtcnv1.ToInt32(i64Value) != i32Value)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_0753cfd! Wrong value returned, " + fmtcnv1.ToInt32(i64Value));
                }
                strValue = "5";
                i32Value = 5;
                iCountTestcases++;
                if (fmtcnv1.ToInt32(strValue) != i32Value)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_197axs! Wrong value returned, " + fmtcnv1.ToInt32(strValue));
                }
                try {
                    iCountTestcases++;
                    strValue = "Hey man";
                    fmtcnv1.ToInt32(strValue);
                    iCountErrors++;
                    Console.WriteLine("Err_1112s! Exception not thrown");
                }catch (FormatException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_dasda213! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    i64Value = Int64.MaxValue;
                    fmtcnv1.ToInt32(i64Value);
                    iCountErrors++;
                    Console.WriteLine("Err_2423cds! Exception not thrown");
                }catch (OverflowException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_0231das! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    fmtcnv1.ToInt32(null);
                    iCountErrors++;
                    Console.WriteLine("Err_84532fd! Exception not thrown");
                }catch (ArgumentNullException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
                }
                i32Value = 5;
                i64Value = 5;
                iCountTestcases++;
                if (fmtcnv1.ToInt64(i32Value) != i64Value)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_452cds! Wrong value returned, " + fmtcnv1.ToInt64(i32Value));
                }
                strValue = "5";
                i64Value = 5;
                iCountTestcases++;
                if (fmtcnv1.ToInt64(strValue) != i64Value)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_234dcd! Wrong value returned, " + fmtcnv1.ToInt64(strValue));
                }
                try {
                    iCountTestcases++;
                    strValue = "Hey man";
                    fmtcnv1.ToInt64(strValue);
                    iCountErrors++;
                    Console.WriteLine("Err_134! Exception not thrown");
                }catch (FormatException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_fdvw! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    dblValue = Double.MaxValue;
                    fmtcnv1.ToInt64(dblValue);
                    iCountErrors++;
                    Console.WriteLine("Err_23084ds! Exception not thrown");
                }catch (OverflowException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1084d! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    fmtcnv1.ToInt64(null);
                    iCountErrors++;
                    Console.WriteLine("Err_84532fd! Exception not thrown");
                }catch (ArgumentNullException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
                }
                i32Value = 5;
                sbtValue = 5;
                iCountTestcases++;
                if (fmtcnv1.ToSByte(i32Value) != sbtValue)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_013248csd! Wrong value returned, " + fmtcnv1.ToSByte(i32Value));
                }
                strValue = "5";
                sbtValue = 5;
                iCountTestcases++;
                if (fmtcnv1.ToSByte(strValue) != sbtValue)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_10732sx! Wrong value returned, " + fmtcnv1.ToSByte(strValue));
                }
                try {
                    iCountTestcases++;
                    strValue = "Hey man";
                    fmtcnv1.ToSByte(strValue);
                    iCountErrors++;
                    Console.WriteLine("Err_632sa! Exception not thrown");
                }catch (FormatException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_6732ds! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    i32Value = 743290;
                    fmtcnv1.ToSByte(i32Value);
                    iCountErrors++;
                    Console.WriteLine("Err_003sw! Exception not thrown");
                }catch (OverflowException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_13853ds! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    fmtcnv1.ToSByte(null);
                    iCountErrors++;
                    Console.WriteLine("Err_84532fd! Exception not thrown");
                }catch (ArgumentNullException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
                }
                i32Value = 5;
                sglValue = 5.0f;
                iCountTestcases++;
                if (fmtcnv1.ToSingle(i32Value) != sglValue)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_0527fds! Wrong value returned, " + fmtcnv1.ToSingle(i32Value));
                }
                strValue = "5";
                sglValue = 5;
                iCountTestcases++;
                if (fmtcnv1.ToSingle(strValue) != sglValue)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_842fsd! Wrong value returned, " + fmtcnv1.ToSingle(strValue));
                }
                try {
                    iCountTestcases++;
                    strValue = "Hey man";
                    fmtcnv1.ToSingle(strValue);
                    iCountErrors++;
                    Console.WriteLine("Err_3421da! Exception not thrown");
                }catch (FormatException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_34123! Wrong exception thrown, " + ex);
                }
                dblValue = Double.MaxValue;
                sglValue = Single.PositiveInfinity;
                iCountTestcases++;
                if (fmtcnv1.ToSingle(dblValue) != sglValue)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_2231dfs! Wrong value returned, " + fmtcnv1.ToSingle(dblValue));
                }
                try {
                    iCountTestcases++;
                    fmtcnv1.ToSingle(null);
                    iCountErrors++;
                    Console.WriteLine("Err_84532fd! Exception not thrown");
                }catch (ArgumentNullException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
                }
                i32Value = 5;
                strValue = "5";
                iCountTestcases++;
                if (!strValue.Equals(fmtcnv1.ToString(i32Value)))
                {
                    iCountErrors++;
                    Console.WriteLine("Err_93472fsd! Wrong value returned, " + fmtcnv1.ToString(i32Value));
                }
                try {
                    iCountTestcases++;
                    fmtcnv1.ToString(null);
                    iCountErrors++;
                    Console.WriteLine("Err_84532fd! Exception not thrown");
                }catch (ArgumentNullException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
                }
                i32Value  = 5;
                ui16Value = 5;
                iCountTestcases++;
                if (fmtcnv1.ToUInt16(i32Value) != ui16Value)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_045fvd! Wrong value returned, " + fmtcnv1.ToUInt16(i32Value));
                }
                strValue  = "5";
                ui16Value = 5;
                iCountTestcases++;
                if (fmtcnv1.ToUInt16(strValue) != ui16Value)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_1834dcvds! Wrong value returned, " + fmtcnv1.ToUInt16(strValue));
                }
                try {
                    iCountTestcases++;
                    strValue = "Hey man";
                    fmtcnv1.ToUInt16(strValue);
                    iCountErrors++;
                    Console.WriteLine("Err_183cs! Exception not thrown");
                }catch (FormatException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_189ws! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    i32Value = Int32.MaxValue;
                    fmtcnv1.ToUInt16(i32Value);
                    iCountErrors++;
                    Console.WriteLine("Err_342fds! Exception not thrown");
                }catch (OverflowException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_6454cd! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    fmtcnv1.ToUInt16(null);
                    iCountErrors++;
                    Console.WriteLine("Err_84532fd! Exception not thrown");
                }catch (ArgumentNullException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
                }
                i32Value  = 5;
                ui32Value = 5;
                iCountTestcases++;
                if (fmtcnv1.ToUInt32(i64Value) != ui32Value)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_7834vfd! Wrong value returned, " + fmtcnv1.ToUInt32(i64Value));
                }
                strValue  = "5";
                ui32Value = 5;
                iCountTestcases++;
                if (fmtcnv1.ToUInt32(strValue) != ui32Value)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_1243vcd! Wrong value returned, " + fmtcnv1.ToUInt32(strValue));
                }
                try {
                    iCountTestcases++;
                    strValue = "Hey man";
                    fmtcnv1.ToUInt32(strValue);
                    iCountErrors++;
                    Console.WriteLine("Err_1234csx! Exception not thrown");
                }catch (FormatException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_5634fsd! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    i64Value = Int64.MaxValue;
                    fmtcnv1.ToUInt32(i64Value);
                    iCountErrors++;
                    Console.WriteLine("Err_0453vdf! Exception not thrown");
                }catch (OverflowException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_0342vfdf! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    fmtcnv1.ToUInt32(null);
                    iCountErrors++;
                    Console.WriteLine("Err_84532fd! Exception not thrown");
                }catch (ArgumentNullException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
                }
                i32Value  = 5;
                ui64Value = 5;
                iCountTestcases++;
                if (fmtcnv1.ToUInt64(i32Value) != ui64Value)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_38503dc! Wrong value returned, " + fmtcnv1.ToUInt64(i32Value));
                }
                strValue  = "5";
                ui64Value = 5;
                iCountTestcases++;
                if (fmtcnv1.ToUInt64(strValue) != ui64Value)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_0173xs! Wrong value returned, " + fmtcnv1.ToUInt64(strValue));
                }
                try {
                    iCountTestcases++;
                    strValue = "Hey man";
                    fmtcnv1.ToUInt64(strValue);
                    iCountErrors++;
                    Console.WriteLine("Err_013csd! Exception not thrown");
                }catch (FormatException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_75421xs! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    dblValue = Double.MaxValue;
                    fmtcnv1.ToUInt64(dblValue);
                    iCountErrors++;
                    Console.WriteLine("Err_3472ds! Exception not thrown");
                }catch (OverflowException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_vefe! Wrong exception thrown, " + ex);
                }
                try {
                    iCountTestcases++;
                    fmtcnv1.ToUInt64(null);
                    iCountErrors++;
                    Console.WriteLine("Err_84532fd! Exception not thrown");
                }catch (ArgumentNullException) {
                }catch (Exception ex) {
                    iCountErrors++;
                    Console.WriteLine("Err_1382cs! Wrong exception thrown, " + ex);
                }
                iCountTestcases++;
                for (int i = 0; i < oArr.Length; i++)
                {
                    oValue = oArr[i];
                    for (int j = 0; j < tpArr.Length; j++)
                    {
                        try{
                            oRtnValue = fmtcnv1.Convert(oValue, tpArr[j]);
                        }catch (Exception ex) {
                            if (ex.ToString().IndexOf("InvalidCastException") == -1)
                            {
                                Console.WriteLine(i + " " + j + " " + ex);
                            }
                        }
                    }
                }
                iCountTestcases++;
                arrTpCodeArr = (TypeCode[])Enum.GetValues(typeof(TypeCode));
                for (int i = 0; i < oArr.Length; i++)
                {
                    oValue = oArr[i];
                    for (int j = 0; j < arrTpCodeArr.Length; j++)
                    {
                        tpcd1 = arrTpCodeArr[j];
                        try{
                            oRtnValue = fmtcnv1.Convert(oValue, tpcd1);
                        }catch (Exception ex) {
                            if (ex.ToString().IndexOf("InvalidCastException") == -1)
                            {
                                Console.WriteLine(i + " " + j + " " + ex);
                            }
                        }
                    }
                }
            } while (false);
        } catch (Exception exc_general) {
            ++iCountErrors;
            Console.WriteLine(s_strTFAbbrev + " : Error Err_8888yyy!  strLoc==" + strLoc + ", exc_general==\n" + exc_general);
        }
        if (iCountErrors == 0)
        {
            Console.WriteLine("paSs.   " + s_strTFPath + " " + s_strTFName + " ,iCountTestcases==" + iCountTestcases.ToString());
            return(true);
        }
        else
        {
            Console.WriteLine("FAiL!   " + s_strTFPath + " " + s_strTFName + " ,iCountErrors==" + iCountErrors.ToString() + " , BugNums?: " + s_strActiveBugNums);
            return(false);
        }
    }