For Programmers: Free Programming Magazines  


Home > Archive > Extreme Programming > February 2005 > nUnit BLL & DAL









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author nUnit BLL & DAL
neubs007

2005-02-09, 8:57 pm

I have a Business Logic layer component that receives a Datatable from
a public static method in the Data Access Layer. How do I write tests
for the BLL since almost exclusively relies on getting info back
(usually datatables) from the DAL. Also at this point there are no
empty constructors (although they will be added in the future)

SP

2005-02-11, 8:57 pm

"neubs007" <neubs007@dodgeit.com> wrote in message
news:1107986949.956351.183630@l41g2000cwc.googlegroups.com...
>I have a Business Logic layer component that receives a Datatable from
> a public static method in the Data Access Layer. How do I write tests
> for the BLL since almost exclusively relies on getting info back
> (usually datatables) from the DAL.


The first dependency you need to break is the one with the DAL. You should
create the datatable as part of the test and supply it to the BLL class you
are testing. However, if you have one class that takes a datatable and
handles all the logic then this might be an excessively large class with too
many methods and should be refactored into smaller classes. These smaller
classes might accept a datarow as a parameter for example.

SP


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com