Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6654641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:24:50+00:00 2026-05-26T01:24:50+00:00

for some test I need to run a data driven test with a configuration

  • 0

for some test I need to run a data driven test with a configuration that is generated (via reflection) in the ClassInitialize method (by using reflection). I tried out everything, but I just can not get the data source properly set up.

The test takes a list of classes in a csv file (one line per class) and then will test that the mappings to the database work out well (i.e. try to get one item from the database for every entity, which will throw an exception when the table structure does not match).

The testmethod is:

[DataSource(
    "Microsoft.VisualStudio.TestTools.DataSource.CSV",
    "|DataDirectory|\\EntityMappingsTests.Types.csv",
    "EntityMappingsTests.Types#csv",
    DataAccessMethod.Sequential)
]
[TestMethod()]
public void TestMappings () {

Obviously the file is EntityMappingsTests.Types.csv. It should be in the DataDirectory.

Now, in the Initialize method (marked with ClassInitialize) I put that together and then try to write it.

WHERE should I write it to? WHERE IS THE DataDirectory?

I tried:

File.WriteAllText(context.TestDeploymentDir + "\\EntityMappingsTests.Types.csv", types.ToString());
File.WriteAllText("EntityMappingsTests.Types.csv", types.ToString());

Both result in “the unit test adapter failed to connect to the data source or read the data”. More exact:

Error details: The Microsoft Jet database engine could not find the
object ‘EntityMappingsTests.Types.csv’. Make sure the object exists
and that you spell its name and the path name correctly.

So where should I put that file?

I also tried just writing it to the current directory and taking out the DataDirectory part – same result. Sadly, there is limited debugging support here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:24:51+00:00Added an answer on May 26, 2026 at 1:24 am

    Please use the ProcessMonitor tool from technet.microsoft.com/en-us/sysinternals/bb896645. Put a filter on MSTest.exe or the associate qtagent32.exe and find out what locations it is trying to load from and at what point in time in the test loading process. Then please provide an update on those details here .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to test a program that first preprocesses some data and then computes
I'm writing some test cases, and I've got a test case that is using
I have several hundred GB of data that I need to paste together using
I am trying to generate some test data. Say I have 1000 appointments that
I need to read some configuration data into environment variables in a bash script.
While developing products, we often need to create proprietary tools to test some of
I have some code in my error handler I need to test against a
I need some like this: module One def test; puts 'Test One'; end end
I need some advice as to how I easily can separate test runs for
I need to copy some records from our SQLServer 2005 test server to our

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.