locked
How to perform Business Layer Testing in 3 tier web application using VS Testing tool. RRS feed

  • Question

  • Hi,

    I am trying to develop testing project for my 3 tier web application using VS Professional edition.

    I stuck on Business layer unit testing.

    Does Business layer unit testing requires any kind of Mock framework?

    Please help me for Business Layer unit testing.

    Tuesday, December 20, 2011 12:13 PM

Answers

  • Hi Nitin,

    Glad to see you again.

     

    If they are all the class files in the Business layer, and they aren’t related to web application, we can just create a unit test for classes like this, if we need set up a unit test with many typing values, we can use the Data-Driven Unit Test instead of typing values into a test method. See http://msdn.microsoft.com/en-us/library/ms182527(v=VS.100).aspx.

     

    But like this thread, if you need to test methods that are part of ASP.NET projects or create the Unit Tests for ASP.NET Web Services, we should follow the Anuj’s suggestion and this article http://msdn.microsoft.com/en-us/library/ms243399(v=VS.100).aspx. There are some differences between unit tests for classes and those for or web application and ASP.NET Web services. For example, when you create unit tests for ASP.NET projects, we have to change the default VSTest host process to ASP.NET Host type, when you create a unit test for ASP.Net Web services, your project must contain an .aspx file and others.

     

    Hope this can help you,

     


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us
    • Marked as answer by Nitin J Jain Thursday, December 22, 2011 10:20 AM
    Thursday, December 22, 2011 7:00 AM