Select to view content in your preferred language

Can we get samples on the best practices for developing unit tests using Runtime and .NET Standard?

1097
4
03-08-2019 10:19 AM
ChrisPalmer1
Emerging Contributor

For example, setting paths to the runtime for the unit testing harnesses, mocking, security, etc.

0 Kudos
4 Replies
TroyFoster
Frequent Contributor

And qt please. My tests use gtest and gmock and I use hooks to monitor when a feature is added or removed from a layer.

0 Kudos
dotMorten_esri
Esri Notable Contributor

Yes! In fact I started working on this yesterday. Hopefully I can get this finished up next week, and will be adding it to this sample:

arcgis-runtime-demos-dotnet/src/CampusRouting at master · Esri/arcgis-runtime-demos-dotnet · GitHub 

...so keep an eye on that repo.

JamesBallard1
Esri Regular Contributor

For the Qt team we use the Qt testing framework. It works quite well and has many nice features. Qt supports unit testing for both C++ and Qml.

Qt Test Overview | Qt Test 5.12 

0 Kudos
dotMorten_esri
Esri Notable Contributor

I added some UWP, iOS and Android unit tests to the Office Locator Sample here: 

https://github.com/Esri/arcgis-runtime-demos-dotnet/pull/28 

It's not anywhere near 100% code coverage, but just to serve as an example, and just chooses one of many test frameworks out there (I just happen to know MSTest and MSTestX the best).

However to be clear: There really isn't anything special about unit testing ArcGIS Runtime Apps. If you want to learn more about how to unit test your apps and libraries, I'd really recommend almost any unit test and/or UI Test tutorial for the platform that you're writing for, and choose the framework that best suit your need. We're really great at writing GIS related libraries, but we leave some of the more generic developer topics to the people who specialize in those things.

I'm curious if you were looking for any GIS specific testing, that isn't already covered by "normal" unit testing?

0 Kudos