ShepherdDev / rock-image-cash-letter

Image Cash Letter implementation for the Rock RMS system.
0 stars 4 forks source link

Unit Tests Needed #5

Open cabal95 opened 6 years ago

cabal95 commented 6 years ago

Basics

Would like to develop a number of unit tests to cover some of the basics like the Micr class and parsing various MICR lines so we know if we break anything when making changes to how MICR lines are parsed.

Sample Exports

I think it would be possible to generate fake batch and transaction data for a unit test to generate a test file. That would allow us to build a unit test to generate, for example, a Bank Of The West file and compare it to a "known good" version of that file. This will be especially helpful once a bank has accepted the file so we know that we don't change how a file renders without intending to - especially if we are modifying the X937DSTU abstract class.

cabal95 commented 6 years ago

There are a few places where we use DateTime.Now. Since that would make the binary data different on each run, we might look at providing some method of overriding the "now" date it the components would use so that unit tests can specify a specific date/time so that the comparison would then work.

This is all entirely predicated on the ability to even generate these test files without a real Rock database.