Esempio n. 1
0
        public void InsertCoin(int Size, int Weight)
        {
            var coin = _commonServices.CalculateCoin(Size, Weight);

            if (coin == null)
            {
                this._displayStack.Add(new DisplayMessage(" This machine does not take washers and Canadian change"));
            }
            else
            {
                if (coin.RejectCoin)
                {
                    this._coinsRejected.Add(coin);
                    this._displayStack.Add(new DisplayMessage(" Coin sent to reject bin.."));
                }
                else
                {
                    this._coinsInserted.Add(coin);
                    this._displayStack.Add(new DisplayMessage(" Amount: " + this.TotalInserted.ToString("c")));
                }
            }
        }