-1

A bit of background: I've been mostly developing in Java and Javascript for the past years and recently i've been moved to a C# project and tasked with implementing a Data Access Layer for this project. As far as i understood it this DAL will call only stored procedures (so no simple sql queries) and return some value if the stored procedure asks for it.

I apologize if this question has been answered before but i was not able to find anything useful.

What would be the best way to test that a DAL is actually calling these stored procedures and returning the results I am expecting? In Java we used Arquillian for integration tests against the DB and it worked great, however i have not been able to find anything like that for C#.

Any help will be appreciated.

DVM
  • 1,229
  • 3
  • 16
  • 22

1 Answers1

1

Write unit tests for your DAL using something like nunit. This can then test that the results are as expected.

ChrisBint
  • 12,773
  • 6
  • 40
  • 62
  • Ok, would i need a local copy of our database for this? – DVM Jul 22 '13 at 12:18
  • @DanielV - Of course. Never test against a live DB! – Corak Jul 22 '13 at 12:20
  • All right :) I was asking because in with arquillian we were using an embeded database and populating it using .yml datasets – DVM Jul 22 '13 at 12:25
  • 1
    As part of our internal testing process, the database project will get automatically built and deployed and you can then test this against the code. The added benefit of this is that the database is also contained in source control as well. – ChrisBint Jul 22 '13 at 12:30