I am writing some unit tests in which I need a fake XML file. I can create this file and require it to be deployed with unit tests, but experience shows that I have a lot of headache in my office. Therefore, I decided that the file would be created by UT.
StreamWriter sw = new StreamWriter(testFileName); sw.Write(contents); sw.Close();
Now the problem is the content bar. This is almost a long xml, something like this:
string contents = @"<?xml version="1.0" encoding="windows-1251"?> <blah> ~100 lines here </blah> ";
I do not want this to be in the same file as the rest of the code. I want the string to be generated at compile time from a file.
In C ++, I would do this
string contents = " #include "test.xml" ";
Is this possible somehow in C #?
source share