c# - Using xUnit test with UWP app on VS2015 -
this follow-up this question. followed steps described here , sample tests work expected. first time got working sample, wait real working setup having trouble.
as next step testing app, added uwp app project using "add reference..." xunit test project. now, after referencing project, when run test (run in test explorer pane vs2015) following error:
error payload contains 2 or more files same destination path 'assets\splashscreen.scale-200.png'. source files: ...\projects\sample\sampleunittest\assets\splashscreen.scale-200.png ...\projects\sample\sample\assets\splashscreen.scale-200.png sampleunittest
there 2 more errors, above, referring square150x150logo.scale-200.png
, square44x44logo.targetsize-24_altform-unplated.png
image files.
i can understand these errors mean; app being tested , test project both generate visual resources (splash-screen image, logo, taskbar icon, etc.) destined same output these required register app(s) , run (on local machine in case). i've never come across such contentious issue of 2 projects outputting same visual resources , knows how solve this. unit test doesn't work if change project class project, not option.
how deal contentious situation (wrt visual resources) between xunit test project , project being tested?
okay, figured out how resolve conflict between visual resources residing in assets folder, leads new kind of issue xunit (which follow-up question).
- for xunit project, rename assets folder to, say, images (or whatever think better alternative name).
- point package.appxmanifest file under xunit project , open code file. this, select package.appxmanifest file , press f7, or right-click file , select view code context menu command.
- in code file, replace folder name assets images or whatever chose rename assets folder with. save it.
now test project compile , run no visual resources output conflicts. regard xunit however, we'll hit problem described in next question.
Comments
Post a Comment