using Thalos.DAL.Health; using Thalos.DAL.Providers; using Thalos.DAL.Repositories; using System.Reflection; namespace Thalos.DAL.UnitTests; public class BoundaryShapeTests { [Fact] public void ProviderBoundaries_WhenReflected_AreInterfaces() { Assert.True(typeof(IUserDataProvider).IsInterface); Assert.True(typeof(IRoleDataProvider).IsInterface); Assert.True(typeof(IPermissionDataProvider).IsInterface); Assert.True(typeof(IModuleDataProvider).IsInterface); Assert.True(typeof(ITenantDataProvider).IsInterface); } [Fact] public void RepositoryAndHealthBoundaries_WhenReflected_AreInterfaces() { Assert.True(typeof(IIdentityRepository).IsInterface); Assert.True(typeof(IDalDependencyHealthCheck).IsInterface); } [Fact] public void IdentityRepository_WhenReflected_ExposesContractMethodsOnly() { var methods = typeof(IIdentityRepository).GetMethods(BindingFlags.Public | BindingFlags.Instance); var methodNames = methods.Select(method => method.Name).OrderBy(name => name).ToArray(); Assert.Equal( ["ReadIdentityPolicyAsync", "ReadIdentityTokenAsync", "ReadPermissionSetAsync"], methodNames); } [Fact] public void ProviderBoundaries_WhenReflected_ExposeReadOnlyMethods() { Assert.Equal("ReadUserAsync", typeof(IUserDataProvider).GetMethods().Single().Name); Assert.Equal("ReadRolesAsync", typeof(IRoleDataProvider).GetMethods().Single().Name); Assert.Equal("ReadPermissionsAsync", typeof(IPermissionDataProvider).GetMethods().Single().Name); Assert.Equal("ReadModulesAsync", typeof(IModuleDataProvider).GetMethods().Single().Name); Assert.Equal("ReadTenantAsync", typeof(ITenantDataProvider).GetMethods().Single().Name); Assert.Equal("CheckAsync", typeof(IDalDependencyHealthCheck).GetMethods().Single().Name); } }