Merge branch 'review/slice-10-bc-recheck'

This commit is contained in:
Leonid Pershin
2026-08-20 18:08:20 +03:00
3 changed files with 38 additions and 7 deletions
@@ -0,0 +1,29 @@
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);
}
}