Implement DiscoverConstructibleTypes() method with HasConstructibleCtor helper to enumerate every non-abstract Item/Mobile subclass in AssemblyHandler.Assemblies that has at least one [Constructible] ctor. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
19 lines
527 B
C#
19 lines
527 B
C#
using Server.Commands;
|
|
using Server.Items;
|
|
using Xunit;
|
|
|
|
namespace UOContent.Tests.Commands.Objects;
|
|
|
|
[Collection("Sequential UOContent Tests")]
|
|
public class ObjectDiscoveryTests
|
|
{
|
|
[Fact]
|
|
public void Discover_includes_concrete_constructibles_and_excludes_abstract()
|
|
{
|
|
var types = ObjectIntrospection.DiscoverConstructibleTypes();
|
|
|
|
Assert.Contains(typeof(Katana), types);
|
|
Assert.Contains(typeof(Runebook), types);
|
|
Assert.DoesNotContain(typeof(BaseWeapon), types); // abstract
|
|
}
|
|
}
|