rama creada apartir de master en j
This commit is contained in:
@@ -13,6 +13,9 @@ namespace adas_core.Test.Repositories;
|
||||
[Category("Integration")]
|
||||
public class TreatmentRepositoryTest
|
||||
{
|
||||
/// <summary>
|
||||
/// One-time test setup that resets the treatments collection, instantiates the repository, and seeds two patient treatments (one with OrderControlType.Nw and one with OrderControlType.Dc) to verify insert behavior.
|
||||
/// </summary>
|
||||
[OneTimeSetUp]
|
||||
public async Task Init()
|
||||
{
|
||||
@@ -45,7 +48,7 @@ public class TreatmentRepositoryTest
|
||||
RequestedGiveCodesStatus =
|
||||
[
|
||||
new CodeStatus
|
||||
{ Code = new Code { CodingSystem = "CS", Identifier = "I", Text = "T" }, Status = "status" }
|
||||
{ Code = new Code { CodingSystem = "CS", Identifier = "I", Text = "T" }, Status = "status" }
|
||||
]
|
||||
};
|
||||
|
||||
@@ -75,6 +78,9 @@ public class TreatmentRepositoryTest
|
||||
private PatientTreatment _treatment2 = null!;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that GetByPatientId returns an empty result collection rather than null when no patient treatments are found for the supplied patient identifier.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public async Task GetByPatientId_Not_Find_Return_Null()
|
||||
{
|
||||
@@ -85,6 +91,10 @@ public class TreatmentRepositoryTest
|
||||
Assert.That(patientTreatments.ToList(), Is.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests that the repository's <c>GetByPatientId</c> method returns the expected patient treatment records
|
||||
/// for the given patient, verifying that the result is not null and contains the expected number of entries.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public async Task GetByPatientId_Find_Return_Null()
|
||||
{
|
||||
@@ -95,6 +105,10 @@ public class TreatmentRepositoryTest
|
||||
Assert.That(patientTreatments.ToList(), Has.Count.EqualTo(2));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="DeleteAsync"/> successfully removes a persisted patient treatment from the repository.
|
||||
/// The test inserts a treatment, confirms it exists, deletes it by id, and asserts it is no longer retrievable.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public async Task DeleteAsync()
|
||||
{
|
||||
@@ -126,6 +140,9 @@ public class TreatmentRepositoryTest
|
||||
Assert.That(resultDelete.ToList(), Has.Count.EqualTo(0));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that <c>FindByPatientIdAsync</c> returns a non-null list containing the expected number of treatments for the specified patient.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public async Task FindByPatientIdAsync_Find_Return_List_Traetments()
|
||||
{
|
||||
@@ -135,6 +152,9 @@ public class TreatmentRepositoryTest
|
||||
Assert.That(result.ToList(), Has.Count.EqualTo(2));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that <see cref="DeleteByPatientId"/> removes the patient treatment associated with the given patient identifier, ensuring no records remain for that patient after deletion.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public async Task DeleteByPatientId()
|
||||
{
|
||||
@@ -166,6 +186,9 @@ public class TreatmentRepositoryTest
|
||||
Assert.That(resultDelete.ToList(), Has.Count.EqualTo(0));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that _repository.FindBolusTreatments returns a non-null collection containing exactly one bolus treatment for the specified patient.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public async Task FindBolusTreatments_Find_Return_Treatment()
|
||||
{
|
||||
@@ -175,6 +198,9 @@ public class TreatmentRepositoryTest
|
||||
Assert.That(result.ToList(), Has.Count.EqualTo(1));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that FindByPatientIdAsync returns a non-null list containing the expected number of treatments for the specified patient.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public async Task FindByPatientId_Find_Return_List_Traetments()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user