Beispiel #1
0
        public Customer(CustomerName customerName, CustomerEmail customerEmail) : this()
        {
            _name  = customerName ?? throw new ArgumentNullException(nameof(customerName));
            _email = customerEmail ?? throw new ArgumentNullException(nameof(customerEmail));

            MoneySpent = Dollars.Of(0);
            Status     = CustomerStatus.Regular;
        }
Beispiel #2
0
        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;
        }