locked
xml RRS feed

  • Question

  • Hi,

     

    Looking for some advice regarding using unit tests on methods and classes that load and process xml files. What I would like is to have a number of xml representations stored somewhere that I can use to test my code. Whats the recommended way of storing the test data and howto connect a unit test to test data. For instance I would like to check if an xml files: x,y and z are loaded \ validated by the code and xml files: a,b and c fail.

     

    Appreciate any input.

    Wednesday, June 20, 2007 1:34 PM

Answers

  • HI Lars1346,

    If you want to run your unit testing project with your test database, you can use the way that medicrob1 said. But you want to use XML file to test your project, I suggest that you just replace your development XML file by the XML file stored your test data. And after test achieved, restore the development XML file.

    I hope this helps.

    Friday, June 22, 2007 4:10 AM

All replies

  • My general suggestion in these cases is to use SQL EXPRESS, in the test environment it is perfect for this. You use the DataSource attribute to identify a connection to the database file then add the file to the deployment window of your test config ... if you need more detail, let me know.
    Wednesday, June 20, 2007 2:51 PM
  • HI Lars1346,

    If you want to run your unit testing project with your test database, you can use the way that medicrob1 said. But you want to use XML file to test your project, I suggest that you just replace your development XML file by the XML file stored your test data. And after test achieved, restore the development XML file.

    I hope this helps.

    Friday, June 22, 2007 4:10 AM