Skip to content

Commit

Permalink
Removed ignored test.
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantina Chremmou <[email protected]>
  • Loading branch information
kc284 committed Oct 6, 2023
1 parent efbc55c commit 41c1027
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions XenAdminTests/CodeTests/AssemblyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,42 +103,6 @@ public void TestEnsureStaticImages()
$"Resources without a static counterpart: {string.Join(", ", extraImages)}");
}

[Ignore("Currently not shipping localized resources")]
[Test, TestCaseSource(typeof(AssemblyTests), nameof(TestCasesForI18NFiles))]
[Description("Checks all resx files in the project have their i18n counterparts in place")]
public void TestEnsureI18NFilesInPlace(TestDataClass tc)
{
var assembly = FindAssemblyByNameRecursively(tc.AssemblyName);
Assert.NotNull($"Assembly {tc.AssemblyName} was not found.");

var excludeFromCheck = new[] {"XenAdmin.Help.HelpManager", "DotNetVnc.KeyMap"};
var missing = new List<string>();
var extra = new List<string>();

List<string> defaultResx = new List<string>(assembly.GetManifestResourceNames().Where(resource => resource.EndsWith("resources")));

CultureInfo cultureInfo = new CultureInfo(tc.Locale);
Assembly localeDll = assembly.GetSatelliteAssembly(cultureInfo);
List<string> localeResx = new List<string>(localeDll.GetManifestResourceNames());

foreach (string def in defaultResx)
{
var name = def.Substring(0, def.Length - ".resources".Length);
var exclude = excludeFromCheck.Contains(name);

string localName = $"{name}.{tc.Locale}.resources";
var localized = localeResx.Contains(localName);

if (localized && exclude)
extra.Add(localName);
else if (!localized && !exclude)
missing.Add(localName);
}

Assert.IsEmpty(missing, "Missing resources detected.");
Assert.IsEmpty(extra, "Unnecessary resources detected.");
}

[Test, TestCaseSource(typeof(AssemblyTests), nameof(TestCasesForRoaming))]
[Description("Checks that if there are user-scoped settings in an assembly, these have roaming=true")]
public void TestUserSettingsAreRoaming(TestDataClass tc)
Expand Down

0 comments on commit 41c1027

Please sign in to comment.