Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created October 29, 2025 15:14
Show Gist options
  • Save dcomartin/bc853483a62f8924a3e10e34d887bd7b to your computer and use it in GitHub Desktop.
Save dcomartin/bc853483a62f8924a3e10e34d887bd7b to your computer and use it in GitHub Desktop.
public class Tests
{
[Fact]
public void Shipment_IsLate_Returns_True_When_Past_Date()
{
var shipment = new Shipment
{
DeliveryDate = DateTime.Today.AddDays(-1)
};
var policy = new StandardDeliveryTiming(DateTime.Today);
Assert.True(shipment.IsLate(policy));
}
[Fact]
public void Shipment_IsLate_Returns_False_When_Not_Past_Date_With_Buffer()
{
var shipment = new Shipment
{
DeliveryDate = DateTime.UtcNow.AddMinutes(-15)
};
var policy = new BufferDeliveryTiming(DateTime.UtcNow, TimeSpan.FromMinutes(30));
Assert.False(shipment.IsLate(policy));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment