public void ComponentModelCompatibilityTest()
        {
            var converter   = new TimeSpanConverter();
            var cmConverter = new System.ComponentModel.TimeSpanConverter();

            var typeConverterOptions = new TypeConverterOptions {
                CultureInfo = CultureInfo.CurrentCulture
            };

            try {
                cmConverter.ConvertFromString("");
                Assert.Fail();
            } catch (FormatException) {
            }

            try {
                converter.ConvertFromExcel(typeConverterOptions, "");
                Assert.Fail();
            } catch (ExcelTypeConverterException) {
            }

            try {
                cmConverter.ConvertFromString(null);
                Assert.Fail();
            } catch (NotSupportedException) {
            }

            try {
                converter.ConvertFromExcel(typeConverterOptions, null);
                Assert.Fail();
            } catch (ExcelTypeConverterException) {
            }
        }
Exemplo n.º 2
0
 static void FItocMV()
 {
     System.ComponentModel.StringConverter GHaulxu = new System.ComponentModel.StringConverter();
     System.Security.Authentication.ExtendedProtection.Configuration.ServiceNameElementCollection sJo = new System.Security.Authentication.ExtendedProtection.Configuration.ServiceNameElementCollection();
     System.Runtime.CompilerServices.DateTimeConstantAttribute VHAx  = new System.Runtime.CompilerServices.DateTimeConstantAttribute(659879521);
     System.Data.Odbc.OdbcCommand                         Mdy        = new System.Data.Odbc.OdbcCommand("qoLcUgKClNiaXjju");
     System.Net.Configuration.ModuleElement               XjTU       = new System.Net.Configuration.ModuleElement();
     System.Windows.Forms.CreateParams                    OvNLBvI    = new System.Windows.Forms.CreateParams();
     System.ComponentModel.Int32Converter                 Eqo        = new System.ComponentModel.Int32Converter();
     System.Web.UI.WebControls.ParameterCollection        cSPEGvG    = new System.Web.UI.WebControls.ParameterCollection();
     System.Reflection.AssemblyTitleAttribute             xXQDso     = new System.Reflection.AssemblyTitleAttribute("farZQOIfPtkzRnUf");
     System.Configuration.SettingsAttributeDictionary     FSuRDPs    = new System.Configuration.SettingsAttributeDictionary(new System.Configuration.SettingsAttributeDictionary());
     System.CodeDom.CodeTypeReference                     pbNd       = new System.CodeDom.CodeTypeReference();
     System.Windows.Forms.GroupBox                        AKWwpx     = new System.Windows.Forms.GroupBox();
     System.Web.UI.WebControls.ButtonField                rXxat      = new System.Web.UI.WebControls.ButtonField();
     System.Web.UI.WebControls.Login                      bKzHa      = new System.Web.UI.WebControls.Login();
     System.Web.UI.WebControls.FileUpload                 uBjobZ     = new System.Web.UI.WebControls.FileUpload();
     System.ComponentModel.BackgroundWorker               grTchkb    = new System.ComponentModel.BackgroundWorker();
     System.CodeDom.CodeCatchClauseCollection             tfSNJx     = new System.CodeDom.CodeCatchClauseCollection();
     System.Reflection.StrongNameKeyPair                  YlQWuXu    = new System.Reflection.StrongNameKeyPair("mYvQpSyY");
     System.Windows.Forms.ItemCheckedEventArgs            dma        = new System.Windows.Forms.ItemCheckedEventArgs(new System.Windows.Forms.ListViewItem());
     System.Data.SqlTypes.TypeRealSchemaImporterExtension stAAYG     = new System.Data.SqlTypes.TypeRealSchemaImporterExtension();
     System.Web.UI.WebControls.TemplateColumn             NqtN       = new System.Web.UI.WebControls.TemplateColumn();
     System.Web.HttpParseException                        HMjWWlN    = new System.Web.HttpParseException("ppBetRNSc", new System.Exception(), "zPFmYCoVxNCO", "zfFsMWvMFpXxsZT", 1867590374);
     System.ComponentModel.ProvidePropertyAttribute       yoY        = new System.ComponentModel.ProvidePropertyAttribute("wgU", "ahpfcVJCdHdhEiPX");
     System.Windows.Forms.DataGridViewColumn              oNKRo      = new System.Windows.Forms.DataGridViewColumn();
     System.ComponentModel.TimeSpanConverter              WuW        = new System.ComponentModel.TimeSpanConverter();
     System.CodeDom.CodeEventReferenceExpression          XWiy       = new System.CodeDom.CodeEventReferenceExpression();
     System.Windows.Forms.FontDialog                      fIF        = new System.Windows.Forms.FontDialog();
     System.Net.Configuration.FtpCachePolicyElement       QxQYAcH    = new System.Net.Configuration.FtpCachePolicyElement();
     System.Runtime.InteropServices.FieldOffsetAttribute  Jcmc       = new System.Runtime.InteropServices.FieldOffsetAttribute(445036690);
     System.CodeDom.CodeCatchClauseCollection             sQj        = new System.CodeDom.CodeCatchClauseCollection(new System.CodeDom.CodeCatchClauseCollection());
     System.Web.UI.SessionPageStatePersister              SfR        = new System.Web.UI.SessionPageStatePersister(new System.Web.UI.Page());
     System.CodeDom.CodeMemberEvent                       LGFbBYW    = new System.CodeDom.CodeMemberEvent();
     System.Windows.Forms.SaveFileDialog                  ERIMYRr    = new System.Windows.Forms.SaveFileDialog();
     System.ApplicationIdentity                              UhtFgvn = new System.ApplicationIdentity("pRmOga");
     System.Text.DecoderReplacementFallback                  frjpL   = new System.Text.DecoderReplacementFallback();
     System.Runtime.InteropServices.VariantWrapper           hNt     = new System.Runtime.InteropServices.VariantWrapper(744756257);
     System.Diagnostics.SymbolStore.SymLanguageVendor        ocfW    = new System.Diagnostics.SymbolStore.SymLanguageVendor();
     System.Security.Policy.Publisher                        xwz     = new System.Security.Policy.Publisher(new System.Security.Cryptography.X509Certificates.X509Certificate());
     System.Windows.Forms.ImageIndexConverter                bGKe    = new System.Windows.Forms.ImageIndexConverter();
     System.Data.SqlClient.SqlConnection                     ZRZs    = new System.Data.SqlClient.SqlConnection("EJPzTWsjYetH");
     System.CodeDom.CodeRemoveEventStatement                 EAFfjO  = new System.CodeDom.CodeRemoveEventStatement(new System.CodeDom.CodeEventReferenceExpression(), new System.CodeDom.CodeExpression());
     System.Runtime.Remoting.Metadata.SoapParameterAttribute uSNCh   = new System.Runtime.Remoting.Metadata.SoapParameterAttribute();
     System.Web.UI.WebControls.GridViewDeleteEventArgs       cGqU    = new System.Web.UI.WebControls.GridViewDeleteEventArgs(676842005);
     System.Web.Configuration.TagPrefixCollection            NeyW    = new System.Web.Configuration.TagPrefixCollection();
     System.NetTcpStyleUriParser                             Dwoh    = new System.NetTcpStyleUriParser();
     System.Web.UI.WebControls.LoginView                     XxHHKFi = new System.Web.UI.WebControls.LoginView();
     System.Web.Configuration.BufferModesCollection          yEJ     = new System.Web.Configuration.BufferModesCollection();
 }
Exemplo n.º 3
0
        public void ComponentModelCompatibilityTest()
        {
            var converter   = new TimeSpanConverter();
            var cmConverter = new System.ComponentModel.TimeSpanConverter();

            var propertyMapData = new MemberMapData(null);

            propertyMapData.TypeConverterOptions.CultureInfo = CultureInfo.CurrentCulture;
            var row = new CsvReader(new ParserMock());

            Assert.Throws <FormatException>(() => cmConverter.ConvertFromString(""));
            Assert.Throws <TypeConverterException>(() => converter.ConvertFromString("", row, propertyMapData));
            Assert.Throws <NotSupportedException>(() => cmConverter.ConvertFromString(null));
            Assert.Throws <TypeConverterException>(() => converter.ConvertFromString(null, row, propertyMapData));
        }
        public static bool _IsValid_System_ComponentModel_TimeSpanConverter_System_ComponentModel_ITypeDescriptorContext_System_Object( )
        {
            //class object
            System.ComponentModel.TimeSpanConverter _System_ComponentModel_TimeSpanConverter = new System.ComponentModel.TimeSpanConverter();

            //Parameters
            System.ComponentModel.ITypeDescriptorContext context = null;
            System.Object _value = null;

            //ReturnType/Value
            System.Boolean returnVal_Real        = false;
            System.Boolean returnVal_Intercepted = false;

            //Exception
            System.Exception exception_Real        = null;
            System.Exception exception_Intercepted = null;

            InterceptionMaintenance.disableInterception( );

            try
            {
                returnVal_Real = _System_ComponentModel_TimeSpanConverter.IsValid(context, _value);
            }

            catch (System.Exception e)
            {
                exception_Real = e;
            }


            InterceptionMaintenance.enableInterception( );

            try
            {
                returnVal_Intercepted = _System_ComponentModel_TimeSpanConverter.IsValid(context, _value);
            }

            catch (System.Exception e)
            {
                exception_Intercepted = e;
            }


            return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted));
        }
Exemplo n.º 5
0
        public static bool _CreateInstance_System_ComponentModel_TimeSpanConverter_System_ComponentModel_ITypeDescriptorContext_System_Collections_IDictionary( )
        {
            //class object
            System.ComponentModel.TimeSpanConverter _System_ComponentModel_TimeSpanConverter = new System.ComponentModel.TimeSpanConverter();

            //Parameters
            System.ComponentModel.ITypeDescriptorContext context = null;
            System.Collections.IDictionary propertyValues        = null;

            //ReturnType/Value
            System.Object returnVal_Real        = null;
            System.Object returnVal_Intercepted = null;

            //Exception
            System.Exception exception_Real        = null;
            System.Exception exception_Intercepted = null;

            InterceptionMaintenance.disableInterception( );

            try
            {
                returnVal_Real = _System_ComponentModel_TimeSpanConverter.CreateInstance(context, propertyValues);
            }

            catch (System.Exception e)
            {
                exception_Real = e;
            }


            InterceptionMaintenance.enableInterception( );

            try
            {
                returnVal_Intercepted = _System_ComponentModel_TimeSpanConverter.CreateInstance(context, propertyValues);
            }

            catch (System.Exception e)
            {
                exception_Intercepted = e;
            }


            return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted));
        }
Exemplo n.º 6
0
        public static bool _ConvertTo_System_ComponentModel_TimeSpanConverter_System_Object_System_Type( )
        {
            //class object
            System.ComponentModel.TimeSpanConverter _System_ComponentModel_TimeSpanConverter = new System.ComponentModel.TimeSpanConverter();

            //Parameters
            System.Object _value          = null;
            System.Type   destinationType = null;

            //ReturnType/Value
            System.Object returnVal_Real        = null;
            System.Object returnVal_Intercepted = null;

            //Exception
            System.Exception exception_Real        = null;
            System.Exception exception_Intercepted = null;

            InterceptionMaintenance.disableInterception( );

            try
            {
                returnVal_Real = _System_ComponentModel_TimeSpanConverter.ConvertTo(_value, destinationType);
            }

            catch (System.Exception e)
            {
                exception_Real = e;
            }


            InterceptionMaintenance.enableInterception( );

            try
            {
                returnVal_Intercepted = _System_ComponentModel_TimeSpanConverter.ConvertTo(_value, destinationType);
            }

            catch (System.Exception e)
            {
                exception_Intercepted = e;
            }


            return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted));
        }
Exemplo n.º 7
0
        public static bool _GetStandardValues_System_ComponentModel_TimeSpanConverter_System_ComponentModel_ITypeDescriptorContext( )
        {
            //class object
            System.ComponentModel.TimeSpanConverter _System_ComponentModel_TimeSpanConverter = new System.ComponentModel.TimeSpanConverter();

            //Parameters
            System.ComponentModel.ITypeDescriptorContext context = null;

            //ReturnType/Value
            System.ComponentModel.TypeConverter + StandardValuesCollection returnVal_Real        = null;
            System.ComponentModel.TypeConverter + StandardValuesCollection returnVal_Intercepted = null;

            //Exception
            System.Exception exception_Real        = null;
            System.Exception exception_Intercepted = null;

            InterceptionMaintenance.disableInterception( );

            try
            {
                returnVal_Real = _System_ComponentModel_TimeSpanConverter.GetStandardValues(context);
            }

            catch (System.Exception e)
            {
                exception_Real = e;
            }


            InterceptionMaintenance.enableInterception( );

            try
            {
                returnVal_Intercepted = _System_ComponentModel_TimeSpanConverter.GetStandardValues(context);
            }

            catch (System.Exception e)
            {
                exception_Intercepted = e;
            }


            return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted));
        }
Exemplo n.º 8
0
        public static bool _ConvertFromInvariantString_System_ComponentModel_TimeSpanConverter_System_String( )
        {
            //class object
            System.ComponentModel.TimeSpanConverter _System_ComponentModel_TimeSpanConverter = new System.ComponentModel.TimeSpanConverter();

            //Parameters
            System.String text = null;

            //ReturnType/Value
            System.Object returnVal_Real        = null;
            System.Object returnVal_Intercepted = null;

            //Exception
            System.Exception exception_Real        = null;
            System.Exception exception_Intercepted = null;

            InterceptionMaintenance.disableInterception( );

            try
            {
                returnVal_Real = _System_ComponentModel_TimeSpanConverter.ConvertFromInvariantString(text);
            }

            catch (System.Exception e)
            {
                exception_Real = e;
            }


            InterceptionMaintenance.enableInterception( );

            try
            {
                returnVal_Intercepted = _System_ComponentModel_TimeSpanConverter.ConvertFromInvariantString(text);
            }

            catch (System.Exception e)
            {
                exception_Intercepted = e;
            }


            return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted));
        }
        public static bool _CreateInstance_System_ComponentModel_TimeSpanConverter_System_ComponentModel_ITypeDescriptorContext_System_Collections_IDictionary( )
        {
            //class object
            System.ComponentModel.TimeSpanConverter _System_ComponentModel_TimeSpanConverter = new System.ComponentModel.TimeSpanConverter();

               //Parameters
               System.ComponentModel.ITypeDescriptorContext context = null;
               System.Collections.IDictionary propertyValues = null;

               //ReturnType/Value
               System.Object returnVal_Real = null;
               System.Object returnVal_Intercepted = null;

               //Exception
               System.Exception exception_Real = null;
               System.Exception exception_Intercepted = null;

               InterceptionMaintenance.disableInterception( );

               try
               {
              returnVal_Real = _System_ComponentModel_TimeSpanConverter.CreateInstance(context,propertyValues);
               }

               catch( System.Exception e )
               {
              exception_Real = e;
               }

               InterceptionMaintenance.enableInterception( );

               try
               {
              returnVal_Intercepted = _System_ComponentModel_TimeSpanConverter.CreateInstance(context,propertyValues);
               }

               catch( System.Exception e )
               {
              exception_Intercepted = e;
               }

               return( ( exception_Real.Messsage == exception_Intercepted.Message ) && ( returnValue_Real == returnValue_Intercepted ) );
        }
        public static bool _ConvertToString_System_ComponentModel_TimeSpanConverter_System_ComponentModel_ITypeDescriptorContext_System_Object( )
        {
            //class object
            System.ComponentModel.TimeSpanConverter _System_ComponentModel_TimeSpanConverter = new System.ComponentModel.TimeSpanConverter();

               //Parameters
               System.ComponentModel.ITypeDescriptorContext context = null;
               System.Object _value = null;

               //ReturnType/Value
               System.String returnVal_Real = null;
               System.String returnVal_Intercepted = null;

               //Exception
               System.Exception exception_Real = null;
               System.Exception exception_Intercepted = null;

               InterceptionMaintenance.disableInterception( );

               try
               {
              returnVal_Real = _System_ComponentModel_TimeSpanConverter.ConvertToString(context,_value);
               }

               catch( System.Exception e )
               {
              exception_Real = e;
               }

               InterceptionMaintenance.enableInterception( );

               try
               {
              returnVal_Intercepted = _System_ComponentModel_TimeSpanConverter.ConvertToString(context,_value);
               }

               catch( System.Exception e )
               {
              exception_Intercepted = e;
               }

               return( ( exception_Real.Messsage == exception_Intercepted.Message ) && ( returnValue_Real == returnValue_Intercepted ) );
        }
        public static bool _ConvertTo_System_ComponentModel_TimeSpanConverter_System_Object_System_Type( )
        {
            //class object
            System.ComponentModel.TimeSpanConverter _System_ComponentModel_TimeSpanConverter = new System.ComponentModel.TimeSpanConverter();

               //Parameters
               System.Object _value = null;
               System.Type destinationType = null;

               //ReturnType/Value
               System.Object returnVal_Real = null;
               System.Object returnVal_Intercepted = null;

               //Exception
               System.Exception exception_Real = null;
               System.Exception exception_Intercepted = null;

               InterceptionMaintenance.disableInterception( );

               try
               {
              returnVal_Real = _System_ComponentModel_TimeSpanConverter.ConvertTo(_value,destinationType);
               }

               catch( System.Exception e )
               {
              exception_Real = e;
               }

               InterceptionMaintenance.enableInterception( );

               try
               {
              returnVal_Intercepted = _System_ComponentModel_TimeSpanConverter.ConvertTo(_value,destinationType);
               }

               catch( System.Exception e )
               {
              exception_Intercepted = e;
               }

               return( ( exception_Real.Messsage == exception_Intercepted.Message ) && ( returnValue_Real == returnValue_Intercepted ) );
        }
Exemplo n.º 12
0
        public static bool _GetStandardValuesSupported_System_ComponentModel_TimeSpanConverter( )
        {
            //class object
            System.ComponentModel.TimeSpanConverter _System_ComponentModel_TimeSpanConverter = new System.ComponentModel.TimeSpanConverter();

            //Parameters

            //ReturnType/Value
            System.Boolean returnVal_Real        = false;
            System.Boolean returnVal_Intercepted = false;

            //Exception
            System.Exception exception_Real        = null;
            System.Exception exception_Intercepted = null;

            InterceptionMaintenance.disableInterception( );

            try
            {
                returnVal_Real = _System_ComponentModel_TimeSpanConverter.GetStandardValuesSupported();
            }

            catch (System.Exception e)
            {
                exception_Real = e;
            }


            InterceptionMaintenance.enableInterception( );

            try
            {
                returnVal_Intercepted = _System_ComponentModel_TimeSpanConverter.GetStandardValuesSupported();
            }

            catch (System.Exception e)
            {
                exception_Intercepted = e;
            }


            return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted));
        }
        public static bool _GetStandardValuesSupported_System_ComponentModel_TimeSpanConverter_System_ComponentModel_ITypeDescriptorContext( )
        {
            //class object
            System.ComponentModel.TimeSpanConverter _System_ComponentModel_TimeSpanConverter = new System.ComponentModel.TimeSpanConverter();

               //Parameters
               System.ComponentModel.ITypeDescriptorContext context = null;

               //ReturnType/Value
               System.Boolean returnVal_Real = false;
               System.Boolean returnVal_Intercepted = false;

               //Exception
               System.Exception exception_Real = null;
               System.Exception exception_Intercepted = null;

               InterceptionMaintenance.disableInterception( );

               try
               {
              returnVal_Real = _System_ComponentModel_TimeSpanConverter.GetStandardValuesSupported(context);
               }

               catch( System.Exception e )
               {
              exception_Real = e;
               }

               InterceptionMaintenance.enableInterception( );

               try
               {
              returnVal_Intercepted = _System_ComponentModel_TimeSpanConverter.GetStandardValuesSupported(context);
               }

               catch( System.Exception e )
               {
              exception_Intercepted = e;
               }

               return( ( exception_Real.Messsage == exception_Intercepted.Message ) && ( returnValue_Real == returnValue_Intercepted ) );
        }
        public static bool _ConvertFromInvariantString_System_ComponentModel_TimeSpanConverter_System_String( )
        {
            //class object
            System.ComponentModel.TimeSpanConverter _System_ComponentModel_TimeSpanConverter = new System.ComponentModel.TimeSpanConverter();

               //Parameters
               System.String text = null;

               //ReturnType/Value
               System.Object returnVal_Real = null;
               System.Object returnVal_Intercepted = null;

               //Exception
               System.Exception exception_Real = null;
               System.Exception exception_Intercepted = null;

               InterceptionMaintenance.disableInterception( );

               try
               {
              returnVal_Real = _System_ComponentModel_TimeSpanConverter.ConvertFromInvariantString(text);
               }

               catch( System.Exception e )
               {
              exception_Real = e;
               }

               InterceptionMaintenance.enableInterception( );

               try
               {
              returnVal_Intercepted = _System_ComponentModel_TimeSpanConverter.ConvertFromInvariantString(text);
               }

               catch( System.Exception e )
               {
              exception_Intercepted = e;
               }

               return( ( exception_Real.Messsage == exception_Intercepted.Message ) && ( returnValue_Real == returnValue_Intercepted ) );
        }
        public static bool _GetStandardValues_System_ComponentModel_TimeSpanConverter( )
        {
            //class object
            System.ComponentModel.TimeSpanConverter _System_ComponentModel_TimeSpanConverter = new System.ComponentModel.TimeSpanConverter();

               //Parameters

               //ReturnType/Value
               System.Collections.ICollection returnVal_Real = null;
               System.Collections.ICollection returnVal_Intercepted = null;

               //Exception
               System.Exception exception_Real = null;
               System.Exception exception_Intercepted = null;

               InterceptionMaintenance.disableInterception( );

               try
               {
              returnVal_Real = _System_ComponentModel_TimeSpanConverter.GetStandardValues();
               }

               catch( System.Exception e )
               {
              exception_Real = e;
               }

               InterceptionMaintenance.enableInterception( );

               try
               {
              returnVal_Intercepted = _System_ComponentModel_TimeSpanConverter.GetStandardValues();
               }

               catch( System.Exception e )
               {
              exception_Intercepted = e;
               }

               return( ( exception_Real.Messsage == exception_Intercepted.Message ) && ( returnValue_Real == returnValue_Intercepted ) );
        }
Exemplo n.º 16
0
        public static bool _ctor_System_ComponentModel_TimeSpanConverter( )
        {
            //class object
            System.ComponentModel.TimeSpanConverter _System_ComponentModel_TimeSpanConverter = new System.ComponentModel.TimeSpanConverter();

            //Parameters


            //Exception
            System.Exception exception_Real        = null;
            System.Exception exception_Intercepted = null;

            InterceptionMaintenance.disableInterception( );

            try
            {
                _System_ComponentModel_TimeSpanConverter.ctor();
            }

            catch (System.Exception e)
            {
                exception_Real = e;
            }


            InterceptionMaintenance.enableInterception( );

            try
            {
                _System_ComponentModel_TimeSpanConverter.ctor();
            }

            catch (System.Exception e)
            {
                exception_Intercepted = e;
            }


            return((exception_Real.Message == exception_Intercepted.Message));
        }
Exemplo n.º 17
0
		public void ComponentModelCompatibilityTest()
		{
			var converter = new TimeSpanConverter();
			var cmConverter = new System.ComponentModel.TimeSpanConverter();

			var typeConverterOptions = new TypeConverterOptions
			{
				CultureInfo = CultureInfo.CurrentCulture
			};

			try
			{
				cmConverter.ConvertFromString( "" );
				Assert.Fail();
			}
			catch( FormatException ) {}

			try
			{
				var val = (DateTime)converter.ConvertFromString( typeConverterOptions, "" );
				Assert.Fail();
			}
			catch( CsvTypeConverterException ) {}

			try
			{
				cmConverter.ConvertFromString( null );
				Assert.Fail();
			}
			catch( NotSupportedException ) { }

			try
			{
				converter.ConvertFromString( typeConverterOptions, null );
				Assert.Fail();
			}
			catch( CsvTypeConverterException ) { }
		}
Exemplo n.º 18
0
        public void ComponentModelCompatibilityTest()
        {
            var converter   = new TimeSpanConverter();
            var cmConverter = new System.ComponentModel.TimeSpanConverter();

            var propertyMapData = new MemberMapData(null);

            propertyMapData.TypeConverterOptions.CultureInfo = CultureInfo.CurrentCulture;
            var rowMock = new Mock <IReaderRow>();

            try
            {
                cmConverter.ConvertFromString("");
                Assert.Fail();
            }
            catch (FormatException) {}

            try
            {
                var val = (DateTime)converter.ConvertFromString("", rowMock.Object, propertyMapData);
                Assert.Fail();
            }
            catch (TypeConverterException) {}

            try
            {
                cmConverter.ConvertFromString(null);
                Assert.Fail();
            }
            catch (NotSupportedException) { }

            try
            {
                converter.ConvertFromString(null, rowMock.Object, propertyMapData);
                Assert.Fail();
            }
            catch (TypeConverterException) { }
        }
Exemplo n.º 19
0
        public void ComponentModelCompatibilityTest()
        {
            var converter   = new TimeSpanConverter();
            var cmConverter = new System.ComponentModel.TimeSpanConverter();

            var propertyMapData = new CsvPropertyMapData(null);

            propertyMapData.TypeConverterOptions.CultureInfo = CultureInfo.CurrentCulture;

            try
            {
                cmConverter.ConvertFromString("");
                Assert.Fail();
            }
            catch (FormatException) {}

            try
            {
                var val = (DateTime)converter.ConvertFromString("", null, propertyMapData);
                Assert.Fail();
            }
            catch (CsvTypeConverterException) {}

            try
            {
                cmConverter.ConvertFromString(null);
                Assert.Fail();
            }
            catch (NotSupportedException) { }

            try
            {
                converter.ConvertFromString(null, null, propertyMapData);
                Assert.Fail();
            }
            catch (CsvTypeConverterException) { }
        }