This is an actual test in my code:
[TestMethod] public void custItemView() { String item = "351000287"; String VenItem = EFData.GetCustomerPartFromView(item); Assert.IsTrue(VenItem.Length > 0); }
My function has a view of all items in our cross-reference tables. Is that found and what is their item number for it. I assert that it will be found, and to verify it was, the length of the string has to have some data.
On Fri, Jul 24, 2020 at 8:20 AM Alan Bourke alanpbourke@fastmail.fm wrote:
I still have trouble conceptualizing how to write unit tests for data access.
That's an integration test, really, not a unit test.
What I do is set up data sets of VFP tables or SQL Server and then zip\unzip the one that applies to the test, as part of the test.
-- Alan Bourke alanpbourke (at) fastmail (dot) fm
[excessive quoting removed by server]