Reputation: 57
Here is the setup I used to reproduce my issue:
Create a UWP Library with the one call as follows:
using namespace Windows::UI::ViewManagement;
void noop() {
auto bounds = ApplicationView::GetForCurrentView()->VisibleBounds;
}
This function uses the ApplicationView to get the screen bounds of the current app instance.
Create another UWP Test App which references the library. Within it's test method, I call the noop() from MyLib.
On running the tests, it fails and throws a Platform::COMException^. Is there something I am missing?
Thanks for your time.
Upvotes: 0
Views: 94
Reputation: 1
You should probably call the noop()
on the UI thread since you are dealing with some UI elements.
You can use [UITestMethod]
instead of [TestMethod]
in top of your test method implementation.
Upvotes: 0