35 lines
967 B
C#
35 lines
967 B
C#
using SGU.AuthBroker.Core.Profiles;
|
|
using SGU.AuthBroker.Services;
|
|
using Xunit;
|
|
|
|
namespace SGU.AuthBroker.Tests;
|
|
|
|
public sealed class ActiveDirectorySynchronizerTests
|
|
{
|
|
[Fact]
|
|
public void GenderMetadataPreservesUnmanagedNotesAndReplacesItsManagedLine()
|
|
{
|
|
const string existing = " Responsable de laboratorio \r\n\r\nSGU-Gender: Male\r\nTurno vespertino";
|
|
|
|
string? updated = ActiveDirectorySynchronizer.MergeGenderMetadata(
|
|
existing,
|
|
InstitutionalGender.Female);
|
|
|
|
Assert.Equal(
|
|
" Responsable de laboratorio \r\n\r\nTurno vespertino\r\nSGU-Gender: Female",
|
|
updated);
|
|
}
|
|
|
|
[Fact]
|
|
public void GenderMetadataDoesNotTruncateAnExistingFullNotesField()
|
|
{
|
|
string existing = new('x', 1024);
|
|
|
|
string? updated = ActiveDirectorySynchronizer.MergeGenderMetadata(
|
|
existing,
|
|
InstitutionalGender.Male);
|
|
|
|
Assert.Null(updated);
|
|
}
|
|
}
|