public void CustomerDto_Extension_AsEntity_Null() { // Arrange CustomerDto customer = null; // Act var result = customer.AsEntity(); // Assert Assert.IsNull(result); Assert.AreEqual(null, result); }
public GenericServiceResponse <bool> DeleteCustomer(CustomerDto customer) { return(TryExecute <GenericServiceResponse <bool> >((response) => { response.Result = Repository.Delete(customer.AsEntity()); if (!response.Result) { var errorMessage = "'DeleteCustomer' was unable to delete the given customer record."; response.Notifications.AddError(errorMessage); Logger.Error(errorMessage); } })); }