I am trying to Include my Unit Test Cases in my Build Pipeline to run these Unit Test Cases as a part of Build. Few of my Test Cases use the Test Data stored in the XML files in the Unit Test Project. These test run successfully in my local system. But when I am trying to run these test case as a part of TFS Build pipeline, these test cases are getting failed since the Build is unable to find these XML files for data.
I tried to replace the config file App Settings for the TFS Build path but it isn't working. Still facing the same failures for the test cases. Also tried include the these files as a part of bin folder, I can see the files are present.
Below is the exception I am getting when I run the Unit Test Run as a part of TFS Build.
Assert.Fail failed. System Exception: Could not find a part of the path 'I:\Agent-Win-C_work\495\s\STARS-2.UnitTests\bin\XMLStore\CustomerRequest.xml'. Stack Trace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy) at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) at System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.CompressedStack.Run(CompressedStack compressedStack, ContextCallback callback, Object state) at System.Xml.XmlTextReaderImpl.OpenUrl() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) at System.Xml.XmlDocument.Load(XmlReader reader) at System.Xml.XmlDocument.Load(String filename) at STARS_2.UnitTests.TestCommon.TestDataCaller.RFCXmlConnect(String fileName) in I:\Agent-Win-C_work\495\s\STARS-2.UnitTests\TestCommon\TestDataCaller.cs:line 16
Any Suggestions to resolve the issue