using Newtonsoft.Json.Linq; using XFEWarframe.Core.Data; using XFEWarframe.Core.Services; using Xunit; namespace XFEWarframe.Tests; public sealed partial class EngineTests { [Theory] [InlineData("en")] [InlineData("zh")] public async Task EveryPublicExportDocumentHasNativeClientShape(string lang) { foreach (var kind in PublicExportApi.Kinds) { var result = await Call($"/PublicExport/Manifest/Export{kind}_{lang}.json!test"); Assert.True(result.Status == 200, $"{kind}: {result.Status} {result.Body}"); var document = JObject.Parse(result.Body); Assert.NotEmpty((JArray)document["Export" + kind]!); } var index = await Call($"/PublicExport/index_{lang}.txt.lzma"); Assert.Equal(200, index.Status); Assert.Equal(Assets.Binary($"fixed_responses/PublicExport/index_{lang}.txt.lzma"), index.BinaryBody); Assert.False(File.Exists(Path.Combine(root, "state.json"))); } [Fact] public async Task ManifestUsesGameIconPathsAndCdnAliasKeepsGameRoute() { var result = await Call("/PublicExport/Manifest/ExportManifest.json!test"); Assert.Equal(200, result.Status); var icons = (JArray)JObject.Parse(result.Body)["Manifest"]!; Assert.NotEmpty(icons); Assert.EndsWith("!00_abcdefghijklmnopqrstuv", icons[0]!.Value("textureLocation")); var world = await Call("/cdn/worldState.php"); Assert.Equal(200, world.Status); Assert.NotEmpty(JObject.Parse(world.Body)["ActiveMissions"]!); } }