<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=931099456970389&amp;ev=PageView&amp;noscript=1">

LegiTest.jpgWhen you’re using LegiTest, you have the benefit of creating one test for information from a data driven source, instead of multiple tests. In this video, I demo how to use the Data Driven Source component within a LegiTest project.

With the Data Driven Source, you can create a group of tests that perform the same functionality across a variety of objects based on information from the data driven source. For instance, if you had multiple tables that needed to be tested in the same way, you can generate the names of those tables in the Data Driven Source, then pass the names of those tables into your queries using the parameters you set.

Let’s say I want to run a file existence test to make sure the files exist based on what I provide.

  • First, I look at a Directory Reference for my data driven source. I will use an edit filter option to look for anything in the full path that ends with the extension .config.
  • Next, I execute this and I get a list of all the .config files.
  • The column names on that list will be used as parameters in my test.
  • Then, going back to my test, I use the File Existence Assertion to run to check if that file exists. I take the column name from my data driven source, in this case Full Path, and add replacement syntax (double curly braces or % around this column name). This column is what I will use to generate the data that will complete this assertion.
  • Looking at the Test Explorers box, after it builds, it will show a list of tests, one for each item in the Full Path and File Existence Test.
  • Lastly, when I run all, this test will run 24 times to confirm that each of these files exist, but I only had to create one test.

This is just a simple example. But the point is that this method can be used to easily create ONE test template, but test multiple objects based on what is being brought back by your data driven source. Need more help? Feel free to contact us in support any time. Our Real People Promise—Our software is supported by real people who actually answer the phone, reply to emails and, if needed, will provide a free web meeting to experience and better understand your issue.

Download LegiTest


Join Our Blog

Join thousands of other SQL Server, BI and cloud pros by subscribing to our blog.

Leave a comment

Posts by Topic

see all

Recent Articles

Popular Articles