using System.Reflection; using HSchool.Server.Game; using HSchool.Simulation; namespace HSchool.Server.Tests; public class PersonCardReaderShapeTests { [Fact] public void PersonCardReader_HasOnePublicRead() { var reader = typeof(PersonCardReader); Assert.True(reader.IsAbstract && reader.IsSealed); Assert.False(reader.IsPublic); var publicMethods = reader.GetMethods( BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly) .Where(method => !method.IsSpecialName) .ToArray(); var read = Assert.Single(publicMethods); Assert.Equal("Read", read.Name); var parameters = read.GetParameters(); Assert.Equal(3, parameters.Length); Assert.Equal(typeof(School), parameters[0].ParameterType); Assert.Equal(typeof(string), parameters[1].ParameterType); Assert.Equal(typeof(string), parameters[2].ParameterType); } }