Improve domain enrollment and desktop personalization

This commit is contained in:
2026-09-07 15:07:04 -06:00
parent c737bd3192
commit 9f32ed2cb1
30 changed files with 1259 additions and 51 deletions
@@ -56,6 +56,58 @@ public sealed class SguProfileParserTests
Assert.Null(SguProfileParser.ParseAdministrative(html, "999999"));
}
[Fact]
public void ParsesOnlyTheSupportedProfessorPayrollHeaderFields()
{
const string html = """
<div id="ctl00_contenedor_decEncabezado_pnlSinPoP">
<span id="ctl00_contenedor_decEncabezado_lblNombre">
013473 - ALEJANDRO LARA VILLARREAL
</span>
<span id="ctl00_contenedor_decEncabezado_lblIndicadorValue">
SINDICALIZADO QUINCENAL (ACTIVO)
</span>
<span id="ctl00_contenedor_decEncabezado_lblCorreo">
alejandro.lara@lasallistas.org.mx
</span>
<img id="ctl00_contenedor_decEncabezado_imgFoto"
src="../admonPersonal/ashx/Fotografia.ashx?id=013473&amp;tp=2" />
<span id="ctl00_contenedor_decEncabezado_lblPuesto">DOCENTE</span>
<span id="ctl00_contenedor_decEncabezado_lblDependencia"></span>
<span id="ctl00_contenedor_decEncabezado_lblJefeNombre">NO EXTRAER</span>
<span id="ctl00_contenedor_decEncabezado_lblJefePuesto">NO EXTRAER</span>
</div>
""";
InstitutionalProfile? profile = SguProfileParser.ParseProfessorPayroll(html, "013473");
Assert.NotNull(profile);
Assert.Equal("013473", profile.EmployeeNumber);
Assert.Equal("Alejandro Lara Villarreal", profile.DisplayName);
Assert.Equal("alejandro.lara@lasallistas.org.mx", profile.Email);
Assert.Equal("Sindicalizado quincenal (activo)", profile.EmployeeType);
Assert.Equal("Docente", profile.JobTitle);
Assert.Null(profile.Department);
Assert.Null(profile.GivenName);
Assert.Null(profile.Surname);
Assert.Null(profile.StreetAddress);
}
[Fact]
public void RejectsProfessorPayrollMetadataForADifferentEmployeeNumber()
{
const string html = """
<span id="ctl00_contenedor_decEncabezado_lblNombre">
013473 - PERSONA INCORRECTA
</span>
<span id="ctl00_contenedor_decEncabezado_lblCorreo">
incorrecta@lasallistas.org.mx
</span>
""";
Assert.Null(SguProfileParser.ParseProfessorPayroll(html, "123456"));
}
[Fact]
public void ParsesStructuredAdministrativeNameWithoutReadingOtherPersonalData()
{