using System.Reflection;
using MessagePack;
namespace GameCult.Thing.Contract.Tests;
/// One name in every runtime: Rust input_kind, C# InputKind, TypeScript inputKind. The wire is the slot key, 2.
public sealed class InputKindNameTests
{
[Test]
public void TextInputNodeSlotTwoIsInputKindAndThereIsNoKind()
{
var properties = typeof(TextInputNode).GetProperties(BindingFlags.Public | BindingFlags.Instance);
var slotTwo = properties.Single(p => p.GetCustomAttribute()?.IntKey == 2);
Assert.That((slotTwo.Name, slotTwo.PropertyType), Is.EqualTo(("InputKind", typeof(InputKind))));
Assert.That(properties.Select(p => p.Name), Does.Not.Contain("Kind"));
Assert.That(typeof(TextInputNode).GetConstructors().Single().GetParameters()[2].Name, Is.EqualTo("inputKind"));
}
}