Seems like people are not getting the whole tag concept. Before you mark this as a duplicate, understand that Thread.CurrentThread.CurrentCulture
does not exist in WinRT/Windows Runtime.
Want to test following code with a culture other than the default:
public string Now =>
DateTime.Now.ToString("g", new CultureInfo(CultureInfo.CurrentUICulture.Name));
So far,
[UITestMethod]
public void UI_NowIsLocalizable()
{
// Arrange
Clock clock = new Clock();
Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "de-DE";
string expected = DateTime.Now.ToString("g");
// Act
string actual = clock.Now;
// Assert
Assert.AreEqual(expected, actual);
}
While debugging the test, CultureInfo.CurrentUICulture.Name
still shows us-en and the test passes (should fail).