Last active
February 28, 2019 12:50
-
-
Save dcomartin/b058d1bc7312fd1965bda6c533748eab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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