UnitTest Project for Database (Stored Procedure) use in BizTalk

Hi All,

In my application i am using C# UnitTest template to write the unit test cases for Maps execution test.

I know there are few other ways to do UnitTesting (BizUnit,Nunit etc), but as per project requirement they want's to use only UnitTest.

I am taking input instance and storing it in Output folder for Scripting functoid testing i am using _extxml.xml files and executing it.

I am consuming SQL server's Stored Procedure in my application using Pooling statement.

How can i test the Select query and insert query (Stored Procedure) using UnitTesting ?

Also does any one know how  to test Orchestration in UnitTesting?

please share sample or any post/Article if any one know this.

Thanks...

August 24th, 2015 1:39am

Hi Nitin,

Need some more input for question #1, 

How can i test the Select query and insert query (Stored Procedure) using UnitTesting ?

Do you want to test your stored procedure with UnitTesing, or is something else. 

If you want to create unit test for SP which runs a query then please please refer below post/article,

Unit testing Select stored procedures

Unit testing update sprocs where more that one table is updated

T.S.T. the T-SQL Test Tool

Database code unit testing tips

Unit-Test Your Stored Procedures

for Question #2, please refer below articles to achieve your scenario,

BizTalk Server - Unit Testing

Excellence: A BizTalk Unit Testing Framework - An Overview

BizUnit 4.0 and BizTalk 2010 - Simple Orchestration

Unit Testing Biztalk : Two possible frameworks

Free Windows Admin Tool Kit Click here and download it now
August 24th, 2015 10:57pm

Hi,

Please refer below TechNet Wiki

http://social.technet.microsoft.com/wiki/contents/articles/6478.biztalk-server-unit-testing.aspx

Thanks

Abhishek

August 25th, 2015 5:22am

Hi Nitin,

Some pointers for Unit testing:

  • From Unit testing in VS, you can test the Maps, Schemas and pipeline components. For more information use the below link:

       https://msdn.microsoft.com/en-us/library/dd224279(v=bts.10).aspx

  • For Unit testing you Stored Procedure, you can write a simple unit test to execute the SP and then comparing the response with what is expected.

Rahul

Free Windows Admin Tool Kit Click here and download it now
August 25th, 2015 8:13am

Hi Rahul,

Any idea ? example ? how to write the unit tests to execute the SP  ?

August 31st, 2015 3:20am

Hi Rahul,

Any idea ? example ? how to write the unit tests to execute the SP  ?

Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 7:05am

Hi Nitin,

Writing Unit test for SQL SP is simple and stright forward. The steps you need to follow:

  • Create a local DB for Unit test
  • Get some sample data (insert or select) in the test datafolder
  • Execute the SP in Unit test with sample data if it is for Inserting the data or send sample parameters if you want to fetch the data from table.
  • Get the response in the Unit test to check it with the expected response.

You can use the below links to check how to write Unit tests for SP:

https://msdn.microsoft.com/en-us/library/jj851212(v=vs.103).aspx

http://www.codeproject.com/Articles/841250/Create-SQL-Server-Database-Unit-Tests

Rahul

August 31st, 2015 9:55am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics