Airship + Unittest (#496)
* wings * update cargo shuttle * update goblin sound * add new unit test * Update CP14EntityTest.cs * Update CP14RitualTest.cs * add buy and sell hints * paper reading * hardwork * clean task * body forkfiltered * Update crystal.yml * more fork flitered * Update basic.yml * Update wild.yml * Update CP14EntityTest.cs * realise pusharing * pusharing alchemical vials * coin disappear works * Fix
This commit is contained in:
37
Content.IntegrationTests/Tests/_CP14/CP14CargoTest.cs
Normal file
37
Content.IntegrationTests/Tests/_CP14/CP14CargoTest.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared._CP14.TravelingStoreShip.Prototype;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.IntegrationTests.Tests._CP14;
|
||||
|
||||
#nullable enable
|
||||
|
||||
[TestFixture]
|
||||
public sealed class CP14CargoTest
|
||||
{
|
||||
[Test]
|
||||
public async Task CheckAllBuyPositionsUniqueCode()
|
||||
{
|
||||
await using var pair = await PoolManager.GetServerClient();
|
||||
var server = pair.Server;
|
||||
|
||||
var compFactory = server.ResolveDependency<IComponentFactory>();
|
||||
var protoManager = server.ResolveDependency<IPrototypeManager>();
|
||||
|
||||
await server.WaitAssertion(() =>
|
||||
{
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
HashSet<string> existedCodes = new();
|
||||
|
||||
foreach (var proto in protoManager.EnumeratePrototypes<CP14StoreBuyPositionPrototype>())
|
||||
{
|
||||
Assert.That(!existedCodes.Contains(proto.Code), $"Repeated purchasing code {proto.Code} of the {proto}");
|
||||
existedCodes.Add(proto.Code);
|
||||
}
|
||||
});
|
||||
});
|
||||
await pair.CleanReturnAsync();
|
||||
}
|
||||
}
|
||||
41
Content.IntegrationTests/Tests/_CP14/CP14EntityTest.cs
Normal file
41
Content.IntegrationTests/Tests/_CP14/CP14EntityTest.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.IntegrationTests.Tests._CP14;
|
||||
|
||||
#nullable enable
|
||||
|
||||
[TestFixture]
|
||||
public sealed class CP14EntityTest
|
||||
{
|
||||
[Test]
|
||||
public async Task CheckAllCP14EntityHasForkFilteredCategory()
|
||||
{
|
||||
await using var pair = await PoolManager.GetServerClient();
|
||||
var server = pair.Server;
|
||||
|
||||
var compFactory = server.ResolveDependency<IComponentFactory>();
|
||||
var protoManager = server.ResolveDependency<IPrototypeManager>();
|
||||
|
||||
await server.WaitAssertion(() =>
|
||||
{
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
if (!protoManager.TryIndex<EntityCategoryPrototype>("ForkFiltered", out var indexedFilter))
|
||||
return;
|
||||
|
||||
foreach (var proto in protoManager.EnumeratePrototypes<EntityPrototype>())
|
||||
{
|
||||
if (!proto.ID.StartsWith("CP14"))
|
||||
continue;
|
||||
|
||||
if (proto.Abstract || proto.HideSpawnMenu)
|
||||
continue;
|
||||
|
||||
Assert.That(proto.Categories.Contains(indexedFilter), $"CP14 fork proto: {proto} does not marked abstract, or have a HideSpawnMenu or ForkFiltered category");
|
||||
}
|
||||
});
|
||||
});
|
||||
await pair.CleanReturnAsync();
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public sealed class CP14RitualTest
|
||||
|
||||
foreach (var edge in phase.Edges)
|
||||
{
|
||||
Assert.That(edge.Triggers.Count > 0, $"{{proto}} is ritual node, but edge to {edge.Target} has no triggers and cannot be activated.");
|
||||
Assert.That(edge.Triggers.Count > 0, $"{proto} is ritual node, but edge to {edge.Target} has no triggers and cannot be activated.");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user