title: How to set CultureInfo for unit tests?
body: <p>Seems like people are not getting the whole tag concept. Before you mark this as a duplicate, understand that <code>Thread.CurrentThread.CurrentCulture</code> does not exist in <strong>WinRT/Windows Runtime</strong>.</p>
  
  <p>Want to test following code with a culture other than the default:</p>
  
  <pre><code>public string Now =&gt;
      DateTime.Now.ToString("g", new CultureInfo(CultureInfo.CurrentUICulture.Name));
  </code></pre>
  
  <p>So far,</p>
  
  <pre><code>[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);
  }
  </code></pre>
  
  <p>While debugging the test, <code>CultureInfo.CurrentUICulture.Name</code> still shows us-en and the test passes (should fail).</p>