I'm writing some unit tests (with xunit) to my WinRT project.
I have prepared text file with json content. I put this file into my Test project and now I want to read file, parse json and check some stuff. It's working for MS Test but failing for xUnit.
When I run test writen with xUnit I receive:
System.InvalidOperationException The process has no package identity. (Exception from HRESULT: 0x80073D54)
[Fact]
public async Task ProjectFile()
{
var folder = Windows.ApplicationModel.Package.Current.InstalledLocation;
folder = await folder.GetFolderAsync("SampleData");
var file = await folder.GetFileAsync("companies.txt");
Assert.NotNull(file);
var result = await Windows.Storage.FileIO.ReadTextAsync(file);
Assert.True(result.Length > 0);
}
My IDE:
Anyone can help here?
I know this question is old, but xUnit.net 1.x did not officially support anything but desktop libraries.
xUnit.net 2.x supports:
Presumably one of these platforms is something you're targeting. ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With