Einen neuen Test für IEnumerable zu BaseDtoTest hinzugefügt.

This commit is contained in:
Developer 02 2024-06-06 15:37:44 +02:00
parent 0e0f78aaa2
commit 132183e1d8

View File

@ -75,5 +75,21 @@ namespace DigitalData.Core.Tests.DTO
Assert.IsFalse(dto1 != dto2);
}
[Test]
public void EntityWithSameIdShouldBeContained()
{
IEnumerable<SampleDto> dtos = new List<SampleDto>() { new(1), new(2) };
var dto = new SampleDto(1);
Assert.That(dtos, Does.Contain(dto));
}
[Test]
public void EntityWithSameIdShouldBeNotContained()
{
IEnumerable<SampleDto> dtos = new List<SampleDto>() { new(1), new(2) };
var dto = new SampleDto(3);
Assert.That(dtos, !Does.Contain(dto));
}
}
}