C# Unit Testing: Testing a method that uses MapPath
First of all, I am aware that this question is dangerously close to: How to MapPath in a unit test in C# I'm hoping however, that it has a different solution. My issue follows: In my code I have an object that needs to be validated. I am creating unit tests for each validation method to make sure it is validating correctly. I am creating mock data and loading it into the object, then validating it. The problem is that within the validation, when an error occurs, an error code is assigned. This error code is used to gather information about the error from an xml file using Server.MapPath.