You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> @jamescrosswell I'm not sure how we would unit test these. Thoughts? The value coming from native is a string. I don't see anyway to simulate all error conditions from native at this time either.
We may not have bulletproof unit tests but perfect is the enemy of good, as they say.
Ultimately this method takes a JsonElement as input. It should be possible to test the method with various different inputs.
In the most basic case, that could be a JsonElement representing some JSON produced by the sentry-dotnet SDK when we serialize a breadcrumb.
For this particular change, it would also be good to test it with the JSON for a breadcrumb that had been serialised using the Native SDK. Worst case, we simply run one of our sample apps and capture that JSON in the console/debug logs then copy/paste into a test. Ideally we could run the most recent version of the Native code during the test to serialise one or more breadcrumbs to JSON and then parse that... which would ensure we were always testing against the JSON produced by the same version of the Native SDK that we embed with sentry-dotnet. Those would obviously have to be device tests.
We may not have bulletproof unit tests but perfect is the enemy of good, as they say.
Ultimately this method takes a JsonElement as input. It should be possible to test the method with various different inputs.
In the most basic case, that could be a JsonElement representing some JSON produced by the sentry-dotnet SDK when we serialize a breadcrumb.
For this particular change, it would also be good to test it with the JSON for a breadcrumb that had been serialised using the Native SDK. Worst case, we simply run one of our sample apps and capture that JSON in the console/debug logs then copy/paste into a test. Ideally we could run the most recent version of the Native code during the test to serialise one or more breadcrumbs to JSON and then parse that... which would ensure we were always testing against the JSON produced by the same version of the Native SDK that we embed with sentry-dotnet. Those would obviously have to be device tests.
Originally posted by @jamescrosswell in #3993 (comment)
The text was updated successfully, but these errors were encountered: