internal PurchasedMovie(Movie movie, Customer customer, Dollars price, ExpirationDate expirationDate) { if (price == null || price.IsZero) { throw new ArgumentException(nameof(price)); } if (expirationDate == null || expirationDate.IsExpired) { throw new ArgumentException(nameof(expirationDate)); } Price = price; Movie = movie ?? throw new ArgumentNullException(nameof(movie)); Customer = customer ?? throw new ArgumentNullException(nameof(customer)); ExpirationDate = expirationDate; PurchaseDate = DateTime.UtcNow; }
private CustomerStatus(CustomerStatusType type, ExpirationDate expirationDate) : this() { _expirationDate = expirationDate ?? throw new ArgumentNullException(nameof(expirationDate)); Type = type; }