public PurchasedMovie(Movie movie, Customer customer, Dollars price) { if (price == null || price.IsZero) { throw new ArgumentException(nameof(price)); } Movie = movie; Customer = customer; Price = price; }
public void PurchaseMovie(Movie movie) { if (HasPurchasedMovie(movie)) { throw new Exception(); } var price = movie.CalculatePrice(Status, DateTime.UtcNow); var purchasedMovie = new PurchasedMovie(movie, this, price); _purchasedMovies.Add(purchasedMovie); MoneySpent += price; }
public Customer(CustomerName name) { Name = name; MoneySpent = Dollars.Of(0); Status = CustomerStatus.Regular; }
private Dollars GetBasePrice() { return(Dollars.Of(10)); }