public void CanAddDelivery_NullDelivery_ThrowsException() { // Arrange DeliveryValidator deliveryValidator = new DeliveryValidator(); Delivery delivery = null; // Act // Assert Assert.ThrowsException <ArgumentNullException>(() => deliveryValidator.CanAddDelivery(delivery)); }
public void CanAddDelivery_DeliveryHasEmptyPrice_ReturnErrorMessage() { // Arrange DeliveryValidator deliveryValidator = new DeliveryValidator(); Delivery delivery = new Delivery(); delivery.Name = "Name"; // Act List <KeyValuePair <string, string> > result = deliveryValidator.CanAddDelivery(delivery); // Assert Assert.IsNotNull(result); Assert.AreEqual(1, result.Count); Assert.AreEqual("Price", result[0].Key); }