2021-02-11 01:13:03 -08:00
|
|
|
#nullable enable
|
2020-11-14 00:27:13 +11:00
|
|
|
using System.Linq;
|
|
|
|
|
using Robust.Client.GameObjects;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Client.ResourceManagement;
|
2020-11-14 00:27:13 +11:00
|
|
|
using Robust.Shared.Prototypes;
|
|
|
|
|
|
|
|
|
|
namespace Content.IntegrationTests.Tests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
2022-06-19 20:22:28 -07:00
|
|
|
public sealed class DummyIconTest
|
2020-11-14 00:27:13 +11:00
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public async Task Test()
|
|
|
|
|
{
|
2023-08-25 02:56:51 +02:00
|
|
|
await using var pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true });
|
|
|
|
|
var client = pair.Client;
|
2023-06-07 21:08:52 +10:00
|
|
|
var prototypeManager = client.ResolveDependency<IPrototypeManager>();
|
2023-10-29 15:29:30 +11:00
|
|
|
var resourceCache = client.ResolveDependency<IResourceCache>();
|
2020-11-14 00:27:13 +11:00
|
|
|
|
|
|
|
|
await client.WaitAssertion(() =>
|
|
|
|
|
{
|
|
|
|
|
foreach (var proto in prototypeManager.EnumeratePrototypes<EntityPrototype>())
|
|
|
|
|
{
|
2024-07-02 20:01:37 -04:00
|
|
|
if (proto.HideSpawnMenu || proto.Abstract || pair.IsTestPrototype(proto) || !proto.Components.ContainsKey("Sprite"))
|
2023-06-07 21:08:52 +10:00
|
|
|
continue;
|
2020-11-14 00:27:13 +11:00
|
|
|
|
2021-02-21 04:51:11 +01:00
|
|
|
Assert.DoesNotThrow(() =>
|
|
|
|
|
{
|
|
|
|
|
var _ = SpriteComponent.GetPrototypeTextures(proto, resourceCache).ToList();
|
|
|
|
|
}, "Prototype {0} threw an exception when getting its textures.",
|
|
|
|
|
proto.ID);
|
2020-11-14 00:27:13 +11:00
|
|
|
}
|
|
|
|
|
});
|
2023-08-25 02:56:51 +02:00
|
|
|
await pair.CleanReturnAsync();
|
2020-11-14 00:27:13 +11:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|