public void WriteRecordsGenericTest()
 {
     var serializer = new SerializerMock( true );
     var writer = new CsvWriter( serializer );
     try
     {
         writer.WriteRecords( new List<Simple> { new Simple() } );
         Assert.Fail();
     }
     catch( CsvHelperException ex )
     {
         Assert.AreEqual( typeof( Simple ), ex.Type );
     }
 }
 public void WriteRecordTest()
 {
     var serializer = new SerializerMock( true );
     var writer = new CsvWriter( serializer );
     try
     {
         writer.WriteRecord( typeof( Simple ), new Simple() );
         Assert.Fail();
     }
     catch( Exception ex )
     {
         var expected = "Type: 'CsvHelper.Tests.Exceptions.ExceptionMessageTests+Simple'\r\n";
         Assert.AreEqual( expected, ex.Data["CsvHelper"] );
     }
 }
 public void WriteRecordGenericTest()
 {
     var serializer = new SerializerMock( true );
     var writer = new CsvWriter( serializer );
     try
     {
         writer.WriteRecord( new Simple() );
         writer.NextRecord();
         Assert.Fail();
     }
     catch( CsvHelperException ex )
     {
         Assert.AreEqual( 1, ex.Row );
     }
 }