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
[tests] Fix recently added AndroidMessageHandler test (#7859)
Context: 5d46685
Context: 7b2e172
Commit 5d46685 -- via [7b2e17][0] -- added usage of the NUnit3
[`RetryAttribute`][1] to some of our on-device unit tests.
Unfortunately, `RetryAttribute` doesn't exist in NUnitLite, resulting
in build failures such as:
…/tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidMessageHandlerTests.cs(42,4):
error CS0246: The type or namespace name 'RetryAttribute' could not be found (are you missing a using directive or an assembly reference?)
Oops.
This failure wasn't caught because we've trained ourselves to
partially ignore various failures in the **Tests** tab -- networking
is hard, mkay? -- but completely missed the *compilation* failures,
which don't appear in the **Tests** tab and are harder to see.
Double oops.
Update `AndroidMessageHandlerTests.cs` to remove usage of `[Retry]`
and instead retry things "manually"
[0]: 7b2e172
[1]: https://docs.nunit.org/articles/nunit/writing-tests/attributes/retry.html
Assert.IsTrue(responseBody.Length>0,"Response was empty");
85
96
Assert.AreEqual(response.Content.Headers.ContentLength,responseBody.Length,"Retrieved data length is different than the one specified in the Content-Length header");
86
97
Assert.IsTrue(responseBody.Contains($"\"{jsonFieldName}\"",StringComparison.OrdinalIgnoreCase),$"\"{jsonFieldName}\" should have been in the response JSON");
0 commit comments