public async Task Test() { var client = StartClient(); await client.WaitIdleAsync(); var prototypeManager = client.ResolveDependency <IPrototypeManager>(); var resourceCache = client.ResolveDependency <IResourceCache>(); await client.WaitAssertion(() => { foreach (var proto in prototypeManager.EnumeratePrototypes <EntityPrototype>()) { if (!proto.Components.ContainsKey("Sprite")) { continue; } Assert.DoesNotThrow(() => { var _ = SpriteComponent.GetPrototypeTextures(proto, resourceCache).ToList(); }, "Prototype {0} threw an exception when getting its textures.", proto.ID); } }); }
public async Task Test() { await using var pairTracker = await PoolManager.GetServerClient(); var client = pairTracker.Pair.Client; var prototypeManager = client.ResolveDependency <IPrototypeManager>(); var resourceCache = client.ResolveDependency <IResourceCache>(); await client.WaitRunTicks(5); await client.WaitAssertion(() => { foreach (var proto in prototypeManager.EnumeratePrototypes <EntityPrototype>()) { if (proto.NoSpawn || proto.Abstract || !proto.Components.ContainsKey("Sprite")) { continue; } Assert.DoesNotThrow(() => { var _ = SpriteComponent.GetPrototypeTextures(proto, resourceCache).ToList(); }, "Prototype {0} threw an exception when getting its textures.", proto.ID); } }); await client.WaitRunTicks(5); await pairTracker.CleanReturnAsync(); }
public async Task Test() { var(client, _) = await StartConnectedServerClientPair(new ClientContentIntegrationOption() { Pool = false }, new ServerContentIntegrationOption() { Pool = false }); var prototypeManager = client.ResolveDependency <IPrototypeManager>(); var resourceCache = client.ResolveDependency <IResourceCache>(); await client.WaitAssertion(() => { foreach (var proto in prototypeManager.EnumeratePrototypes <EntityPrototype>()) { if (proto.Abstract || !proto.Components.ContainsKey("Sprite")) { continue; } Assert.DoesNotThrow(() => { var _ = SpriteComponent.GetPrototypeTextures(proto, resourceCache).ToList(); }, "Prototype {0} threw an exception when getting its textures.", proto.ID); } }); }
public async Task Test() { var client = StartClient(); await client.WaitIdleAsync(); var prototypeManager = client.ResolveDependency <IPrototypeManager>(); var resourceCache = client.ResolveDependency <IResourceCache>(); await client.WaitAssertion(() => { foreach (var proto in prototypeManager.EnumeratePrototypes <EntityPrototype>()) { if (!proto.Components.ContainsKey("Sprite")) { continue; } SpriteComponent.GetPrototypeTextures(proto, resourceCache).ToList(); } }); }