How do I include a file needed to perform a test in the context of running Live Unit Testing

Asked

Viewed 10 times

0

Good afternoon to you all.

My unit tests depend on a configuration file to pass. However, when tests run through Live Unit Testing (LUT) they fail by not finding such a file.

Currently the ULT runs within [...]\.vs\[solução]\lut\0\t\[projeto]\Debug\netcoreapp2.0. No use throwing the file in this folder because it disappears every time the LUT runs.

So, how do I include a file needed to perform a test in the context of running Live Unit Testing?

  • 1

    Dude, I remember that in the file properties you select what should happen to it in the build process. It has a shape that makes it stay in the bin folder. It helps you?

  • Ok, it worked! You’re talking about the "Copy to output directory". I had tested it before but I shouldn’t have given time for the copy to be done. Thanks!

  • Imagine... I’m glad it worked!

1 answer

0

Diegosantos brought light to the problem. Just change the "Copy to Output Directory" property of the file to "Copy Aways".

Valeu Diego!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.