I've created an app for Windows 8 metro (aka WinRT) in Visual Studio 2013. I'm saving user data by serializing to XML using DataContractSerializer. I've also added a Unit Test Project for unit testing. I'd like to test saving/loading from XML. It works just fine in my app, and I can browse to the "LocalState" folder and verify that the XML contains the correct data. However, the unit test method doesn't seem to create any XML file like the main app, despite claiming to have "passed".
Does the unit test store its data somewhere else? How can I actually get to the XML file? Ideally I'd like to use the unit test to also generate large data sets and then load them in the main app, so simply saving/loading/checking for equality is not enough.
Here's the code I"m using to save data, which again works fine in the main app.
string localData = ObjectSerializer<myObject>.Serialize(_myObject);
if (!string.IsNullOrEmpty(localData))
{
StorageFile localFile = await ApplicationData.Current.LocalFolder.CreateFileAsync("Data.xml", CreationCollisionOption.ReplaceExisting);
await FileIO.WriteTextAsync(localFile, localData);
}