/// <summary> /// Create instance of BankAccountService. /// </summary> /// <param name="account"></param> /// <param name="storage"></param> /// <param name="exchenger"></param> public BankAccountService(IBankAccount account, IAccountStorage storage, IBallExchenger exchenger) { this.CurrentAccount = account ?? throw new ArgumentNullException("account", "Try to set null as IBankAccount."); this.Storage = storage ?? throw new ArgumentNullException("storage", "Try to set null as IAccountStorage."); this.Exchenger = exchenger ?? throw new ArgumentNullException("exchenger", "Try to set null as IBallExchenger."); }
/// <summary> /// Set another class(inherit BallExchenger) to get balls from action with money. /// </summary> /// <param name="type"></param> public void ChangeExchenger(BallExchenger type) { if (type == null) { throw new ArgumentNullException("type", "Try to set null as BallExchenger."); } this.Exchenger = type; }