I'm currently maintaining an "old" system written in C#.net, removing some obsolete features and doing some refactoring. Thanks god, the previous guy wrote some unit tests (MSTests). I quite comfortable with JUnit tests, but didn't do yet much with MSTests.
The test methods have a DeploymentItem
attribute, specifying a text file which is parsed by the business logic method that is being tested and a 2nd DeploymentItem
where just a path has been specified containing a bunch of TIF files that have to be deployed too.
[TestMethod()]
[DeploymentItem(@"filesvalidvalid_entries.txt")]
[DeploymentItem(@"filesif")]
public void ExistsTifTest()
{
...
}
The tests worked before, but now I had to change the names of the TIF files contained in the filesif directory. According to a rule, the TIF filenames have to match a certain pattern which is also checked by the ExistsTifTest()
method.
Now I had to change the filenames in order to adapt them to the new requirements and suddently the TIF files are no more being deployed as before.
Can someone give me a hint why this happens or what may be the cause? The same thing happens also if I add a new text-file say "my2ndTest.txt" beside the "valid_entries.txt" in the filesvalid directory with the according DeploymentItem attribute on the test method. The file doesn't get deployed?
I got the images now deployed by defining the deployment path directly in the testrunconfig, but I'd like to understand why these things happen or why for instance my new file "my2ndTest.txt" doesn't get deployed while the others do.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…