DummyIconTest.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #nullable enable
  2. using System.Linq;
  3. using Robust.Client.GameObjects;
  4. using Robust.Client.ResourceManagement;
  5. using Robust.Shared.Prototypes;
  6. namespace Content.IntegrationTests.Tests
  7. {
  8. [TestFixture]
  9. public sealed class DummyIconTest
  10. {
  11. [Test]
  12. public async Task Test()
  13. {
  14. await using var pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true });
  15. var client = pair.Client;
  16. var prototypeManager = client.ResolveDependency<IPrototypeManager>();
  17. var resourceCache = client.ResolveDependency<IResourceCache>();
  18. await client.WaitAssertion(() =>
  19. {
  20. foreach (var proto in prototypeManager.EnumeratePrototypes<EntityPrototype>())
  21. {
  22. if (proto.HideSpawnMenu || proto.Abstract || pair.IsTestPrototype(proto) || !proto.Components.ContainsKey("Sprite"))
  23. continue;
  24. Assert.DoesNotThrow(() =>
  25. {
  26. var _ = SpriteComponent.GetPrototypeTextures(proto, resourceCache).ToList();
  27. }, "Prototype {0} threw an exception when getting its textures.",
  28. proto.ID);
  29. }
  30. });
  31. await pair.CleanReturnAsync();
  32. }
  33. }
  34. }