Skip to content

Commit

Permalink
[tests] Adjust resources test to cope with the fact that only the inv…
Browse files Browse the repository at this point in the history
…ariant culture is currently shipping in .NET 5. (xamarin#9498)

Ref: xamarin#8906

This is the third of three steps to fix this test failure:

    EmbeddedResources.ResourcesTest
        [FAIL] Embedded :   en-AU
            Expected string length 5 but was 7. Strings differ at index 0.
            Expected: "G'day"
            But was:  "Welcome"
            -----------^
                at EmbeddedResources.ResourcesTest.Embedded() in [...]/xamarin-macios/tests/EmbeddedResources/ResourcesTest.cs:line 45
  • Loading branch information
rolfbjarne committed Aug 26, 2020
1 parent 0a39dbc commit 6a1e8ac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/EmbeddedResources/ResourcesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ public void Embedded ()
Assert.AreEqual ("Welcome", manager.GetString ("String1", new CultureInfo ("en")), "en");
Assert.AreEqual ("G'day", manager.GetString ("String1", new CultureInfo ("en-AU")), "en-AU");
Assert.AreEqual ("Willkommen", manager.GetString ("String1", new CultureInfo ("de")), "de");
#if !NET // https://github.com/xamarin/xamarin-macios/issues/8906
Assert.AreEqual ("Willkommen", manager.GetString ("String1", new CultureInfo ("de-DE")), "de-DE");
#endif
Assert.AreEqual ("Bienvenido", manager.GetString ("String1", new CultureInfo ("es")), "es");
#if !NET // https://github.com/xamarin/xamarin-macios/issues/8906
Assert.AreEqual ("Bienvenido", manager.GetString ("String1", new CultureInfo ("es-AR")), "es-AR");
Assert.AreEqual ("Bienvenido", manager.GetString ("String1", new CultureInfo ("es-ES")), "es-ES");
#endif
}
}
}

0 comments on commit 6a1e8ac

Please sign in to comment.