How to use Nunit for DAL methods which in turn use stored procedures

Posted by Mallika under Regular Expressions on 3/20/2009 | Views : 3920 | Status : [Member] | Replies : 1
Hi I am new to .net.

In my project there is a business layer and a Data Access Layer. The data access layer are methods which in turn use stored procedures. I need to write test cases for these Data Access layer and then later the business layer. I have been told to do it by using Nunit.
can someone please guide me on it. How should i start.i have gone through many tutorials but i didn't properly understand how to write test cases for my DAL methods which in turn use stored procedures.
Any help is appreciated.


I would also like to know is it useful and feasible to write test cases for all the methods in the DAL. if no then please suggest other alternative and the reason why its not feasible.

Regards




Responses

Posted by: Vuyiswamb on: 3/20/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Day Mallika

Mallika wrote
I need to write test cases for these Data Access layer and then later the business layer. I have been told to do it by using Nunit.

You cannot test a BLL without a DAL, a BLL depends on a DAL and its no use to test a DAL without a BLL. Its better you implement them both and test them both. but still you can implement testing without a BLL and set a reference in your PL(Presentation) to a DAL , but when you are done with testing you must remove the reference, because remember a PL must never access the DAL directly.


Mallika wrote
can someone please guide me on it. How should i start.i have gone through many tutorials but i didn't properly understand how to write test cases for my DAL methods which in turn use stored procedures.

Well i have never written any test cases for that , dont think i will. for more info on the N-Tier look at this

http://www.codeproject.com/KB/cs/NTier.aspx

http://www.codeproject.com/KB/cs/N-Tier22.aspx

http://www.codeproject.com/KB/vb/N-Tier_Application_VB.aspx

Thank you for Posting at .NETFUNDA.

We are looking forward for your reply

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Mallika, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response