Skip to content

Commit

Permalink
[browser] Fix passing parameter to test added in #108190 (#108199)
Browse files Browse the repository at this point in the history
  • Loading branch information
maraf authored Sep 25, 2024
1 parent 080fcae commit bdcfb10
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,24 @@ public async Task LoadSatelliteAssembly(bool loadAllSatelliteResources)
var result = await RunSdkStyleAppForBuild(new(
Configuration: "Debug",
TestScenario: "SatelliteAssembliesTest",
BrowserQueryString: new Dictionary<string, string> { ["loadAllSatelliteResources"] = loadAllSatelliteResources.ToString() }
BrowserQueryString: new Dictionary<string, string> { ["loadAllSatelliteResources"] = loadAllSatelliteResources.ToString().ToLowerInvariant() }
));

var expectedOutput = new List<Action<string>>();
if (!loadAllSatelliteResources)
{
// If we are loading all satellite, we don't have a way to test resources without satellite assemblies being loaded.
// So there messages are should be present only when we are lazily loading satellites.
expectedOutput.Add(m => Assert.Equal("default: hello", m));
expectedOutput.Add(m => Assert.Equal("es-ES without satellite: hello", m));
}

expectedOutput.Add(m => Assert.Equal("default: hello", m));
expectedOutput.Add(m => Assert.Equal("es-ES with satellite: hola", m));

Assert.Collection(
result.TestOutput,
m => Assert.Equal("default: hello", m),
m => Assert.Equal("es-ES without satellite: hello", m),
m => Assert.Equal("default: hello", m),
m => Assert.Equal("es-ES with satellite: hola", m)
expectedOutput.ToArray()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ public partial class SatelliteAssembliesTest
[JSExport]
public static async Task Run(bool loadSatelliteAssemblies)
{
ResourceLibrary.ResourceAccessor.Read(TestOutput.WriteLine, false);

if (loadSatelliteAssemblies)
{
ResourceLibrary.ResourceAccessor.Read(TestOutput.WriteLine, false);
await LoadSatelliteAssemblies(new[] { "es-ES" });
}

ResourceLibrary.ResourceAccessor.Read(TestOutput.WriteLine, true);
}
Expand Down

0 comments on commit bdcfb10

Please sign in to comment.