2021-02-11 01:13:03 -08:00
|
|
|
#nullable enable
|
2020-11-14 00:27:13 +11:00
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using Robust.Client.GameObjects;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Client.ResourceManagement;
|
2021-09-27 14:51:17 +10:00
|
|
|
using Robust.Shared.GameObjects;
|
2020-11-14 00:27:13 +11:00
|
|
|
using Robust.Shared.Prototypes;
|
|
|
|
|
|
|
|
|
|
namespace Content.IntegrationTests.Tests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class DummyIconTest : ContentIntegrationTest
|
2020-11-14 00:27:13 +11:00
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public async Task Test()
|
|
|
|
|
{
|
2021-11-08 12:43:06 +01:00
|
|
|
var (client, _) = await StartConnectedServerClientPair(new ClientContentIntegrationOption(){ Pool = false }, new ServerContentIntegrationOption() { Pool = false });
|
2020-11-14 00:27:13 +11:00
|
|
|
|
|
|
|
|
var prototypeManager = client.ResolveDependency<IPrototypeManager>();
|
|
|
|
|
var resourceCache = client.ResolveDependency<IResourceCache>();
|
|
|
|
|
|
|
|
|
|
await client.WaitAssertion(() =>
|
|
|
|
|
{
|
|
|
|
|
foreach (var proto in prototypeManager.EnumeratePrototypes<EntityPrototype>())
|
|
|
|
|
{
|
2021-02-22 14:53:11 +01:00
|
|
|
if (proto.Abstract || !proto.Components.ContainsKey("Sprite")) 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
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|