Premiere commit - Omika

This commit is contained in:
2026-10-23 18:46:50 +02:00
commit 8ea76c1b24
2155 changed files with 984301 additions and 0 deletions
@@ -0,0 +1,69 @@
using Omika.Core.Domain.Entities.Planning;
using Omika.Core.Domain.ValueObjects;
namespace Omika.Tests.Domain;
/// <summary>
/// Tests de l'agrégat métier canonique <see cref="RendezVous"/>, unique pour
/// l'ancien et le nouveau schéma de base.
/// </summary>
public class RendezVousDomainTests
{
[Fact]
public void RendezVous_IsIndependentOfPhysicalTableNames()
{
var rendezVous = new RendezVous();
string[] forbidden = ["Planning_RDV", "RDV_Planning", "RDP_GUID", "PL_PKID"];
Assert.DoesNotContain(forbidden, name => rendezVous.GetType().Name.Contains(name, StringComparison.Ordinal));
foreach (var property in rendezVous.GetType().GetProperties())
{
Assert.DoesNotContain(forbidden, name => property.Name.Contains(name, StringComparison.Ordinal));
}
}
[Fact]
public void RendezVous_HoldsPeriodeAsValueObject()
{
var rendezVous = new RendezVous
{
Titre = "Visite",
Periode = new DateTimeRange(new DateTime(2026, 2, 1, 9, 0, 0), new DateTime(2026, 2, 1, 11, 0, 0))
};
Assert.Equal(new DateTime(2026, 2, 1, 9, 0, 0), rendezVous.Periode.Start);
Assert.Equal(new DateTime(2026, 2, 1, 11, 0, 0), rendezVous.Periode.End);
}
[Fact]
public void RendezVous_CanCarryCollaborateursAndContacts()
{
var rendezVous = new RendezVous();
rendezVous.AddCollaborateur(new AffectationCollaborateur { CollaborateurId = Guid.NewGuid(), Responsable = true });
rendezVous.AddCollaborateur(new AffectationCollaborateur { CollaborateurId = Guid.NewGuid() });
rendezVous.AddContact(new ParticipantRendezVous { ContactId = Guid.NewGuid(), PresenceConfirmee = true });
Assert.Equal(2, rendezVous.Collaborateurs.Count);
Assert.Single(rendezVous.Contacts);
Assert.True(rendezVous.Contacts[0].PresenceConfirmee);
}
[Fact]
public void RendezVous_CanCarryAnnulation()
{
var rendezVous = new RendezVous
{
Annulation = new AnnulationRendezVous
{
DateAnnulation = new DateTime(2026, 2, 1, 8, 0, 0),
Commentaire = "Reporté"
}
};
Assert.NotNull(rendezVous.Annulation);
Assert.Equal("Reporté", rendezVous.Annulation.Commentaire);
}
}