Skip to content

Instantly share code, notes, and snippets.

@dcomartin dcomartin/Shipment.cs
Last active Feb 28, 2019

Embed
What would you like to do?
public class Shipment
{
private DateTime? _delivery;
private string _proofOfDelivery;
public Shipment(Guid shipmentID)
{
// Load current state
}
public void Deliver(DateTime delivery, string proofOfDelivery)
{
if (_delivery != null)
{
throw new InvalidOperationException("Already delivered.");
}
_delivery = delivery;
_proofOfDelivery = proofOfDelivery;
}
public bool IsDelievered()
{
return _delivery.HasValue;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.