I have a function code like this:
public static async Task<bool> RemoveUnitFile(string unitType)
{
if (!unitType.ToLower().EndsWith(".xml"))
{
unitType = unitType + ".xml";
}
StorageFolder local = ApplicationData.Current.LocalFolder;
try
{
StorageFile file = await local.GetFileAsync(unitType);
await file.DeleteAsync();
return true;
}
catch
{
return false;
}
}
And I'm trying to create a Unit Test function:
[TestMethod]
public async void TestDeleteFile()
{
Assert.IsTrue(await DataAccess.RemoveUnitFile("Units"));
}
But after I build the Test project, the test method TestDeleteFile is not exist in the test explorer, how can I test the async functions??