> I still have trouble conceptualizing how to write unit tests for data
> access.

I have a function that reads a table and recreates the same structure as an 
empty cursor with all indexes, and such. Optionally, it appends the existing 
content of the table. In my unit test I can then make changes to the cursor.

This covers about 80-90% of the need if you have a common way of opening tables 
that you can plug into. For test cases, where a cursor is too different from 
the table for a useful test, I do have test data in a subfolder that I copy 
into a temporary folder and then use for the test. 

For projects that use a more object oriented approach I use foxmock to simulate 
data. Most times what I really need isn't the actual data access, because I 
know that these classes work, rather I have to test the code that accesses 
data. foxmock has a method that returns a scatter object based on a record.

-- 
Christof

--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/ece0761d-3fe8-4fa8-8c21-066753ace...@wollenhaupt.org
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to