Files
tbd-station-14/Content.IntegrationTests/Tests/DummyIconTest.cs
DrSmugleaf b1be93fbce Show the prototype id when failing dummy icon test (#3340)
* Show the prototype id when failing dummy icon test

* Remove redundant import
2021-02-21 14:51:11 +11:00

39 lines
1.2 KiB
C#

#nullable enable
using System.Linq;
using System.Threading.Tasks;
using NUnit.Framework;
using Robust.Client.GameObjects;
using Robust.Client.ResourceManagement;
using Robust.Shared.Prototypes;
namespace Content.IntegrationTests.Tests
{
[TestFixture]
public class DummyIconTest : ContentIntegrationTest
{
[Test]
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);
}
});
}
}
}