ModernUO/Projects/UOContent.Tests/Tests/Commands/Objects/ObjectIntrospectionCtorsTests.cs
Kamron Batman d72313b76b
style(objects): drop unused System.Linq imports in extraction tests
Assert.Single(collection, predicate) is an xUnit overload, not LINQ.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:38:04 -07:00

23 lines
774 B
C#

using Server.Commands;
using Server.Items;
using Xunit;
namespace UOContent.Tests.Commands.Objects;
[Collection("Sequential UOContent Tests")]
public class ObjectIntrospectionCtorsTests
{
[Fact]
public void ExtractCtors_lists_both_constructible_runebook_overloads()
{
// Runebook has [Constructible] Runebook() and [Constructible] Runebook(int maxCharges).
var ctors = ObjectIntrospection.ExtractCtors(typeof(Runebook));
Assert.Equal(2, ctors.Count);
Assert.Contains(ctors, c => c.Parameters.Count == 0);
var parameterized = Assert.Single(ctors, c => c.Parameters.Count == 1);
Assert.Equal("maxCharges", parameterized.Parameters[0].Name);
Assert.Equal("int", parameterized.Parameters[0].Type);
}
}