MoreDotNet icon indicating copy to clipboard operation
MoreDotNet copied to clipboard

Cover ListExtensions with unit tests

Open Teodor92 opened this issue 7 years ago • 1 comments

Teodor92 avatar Oct 02 '16 10:10 Teodor92

I've submitted a pr for BinarySearch.

I'm almost done with ToDataTable(), but it looks like this won't work correctly on lists of C# built-in types like string, int, etc. String throws an exception, int gives a datable with the correct # of rows, but no values in those rows.

So I'm wondering if ToDataTable() should have a check to make sure we aren't trying to make a datable out of a list of built-in system types?

There's a few ways to do it:

  • we could do myName.GetType().Namespace and check if it has system in it.
  • we could also do something like this: http://stackoverflow.com/a/15578098

jeremywho avatar Oct 29 '16 14:10 jeremywho