rama creada apartir de master en j
This commit is contained in:
@@ -62,21 +62,25 @@ public class ObservationArchiveRepositoryTest
|
||||
private static readonly ObjectId PatientId = ObjectId.GenerateNewId();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that the repository's <c>DeleteBeforeDate</c> method removes all patient observations
|
||||
/// dated before the specified cutoff, leaving only a single observation remaining in the collection.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public async Task DeleteBeforeDate()
|
||||
{
|
||||
var filter = Builders<PatientObservation>.Filter.Eq(p => p.PatientId, PatientId);
|
||||
|
||||
var result = await _repository.Collection.FindAsync(filter);
|
||||
|
||||
Assert.That(result, Is.Not.Null);
|
||||
Assert.That(result.ToList(), Has.Count.GreaterThan(1));
|
||||
|
||||
await _repository.DeleteBeforeDate(Now);
|
||||
|
||||
var resultDelete = await _repository.Collection.FindAsync(filter);
|
||||
|
||||
Assert.That(resultDelete, Is.Not.Null);
|
||||
Assert.That(resultDelete.ToList(), Has.Count.EqualTo(1));
|
||||
}
|
||||
public async Task DeleteBeforeDate()
|
||||
{
|
||||
var filter = Builders<PatientObservation>.Filter.Eq(p => p.PatientId, PatientId);
|
||||
|
||||
var result = await _repository.Collection.FindAsync(filter);
|
||||
|
||||
Assert.That(result, Is.Not.Null);
|
||||
Assert.That(result.ToList(), Has.Count.GreaterThan(1));
|
||||
|
||||
await _repository.DeleteBeforeDate(Now);
|
||||
|
||||
var resultDelete = await _repository.Collection.FindAsync(filter);
|
||||
|
||||
Assert.That(resultDelete, Is.Not.Null);
|
||||
Assert.That(resultDelete.ToList(), Has.Count.EqualTo(1));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user