GivenDotnetTestsRunsInDifferentCultures.cs 915 B

12345678910111213141516171819202122232425262728293031
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. using Microsoft.DotNet.Tools.Test.Utilities;
  4. namespace Microsoft.DotNet.Cli.Test.Tests;
  5. public class CultureAwareTestProject : SdkTest
  6. {
  7. private const string TestAppName = "TestAppSimple";
  8. public CultureAwareTestProject(ITestOutputHelper log) : base(log)
  9. {
  10. }
  11. [InlineData("en-US")]
  12. [InlineData("de-DE")]
  13. [Theory]
  14. public void CanRunTestsAgainstProjectInLocale(string locale)
  15. {
  16. var testAsset = _testAssetsManager.CopyTestAsset(TestAppName)
  17. .WithSource()
  18. .WithVersionVariables();
  19. var command = new DotnetTestCommand(Log, disableNewOutput: true).WithWorkingDirectory(testAsset.Path).WithCulture(locale);
  20. var result = command.Execute();
  21. result.ExitCode.Should().Be(0);
  22. }
  23. }