예제 #1
0
        public void DispenseChange_ReturnsAvailableFunds()
        {
            AddRandomFunds();

            var expectedChange = _transactionHandler.AvailableFunds;

            var actualChange = _transactionHandler.DispenseChange();

            Assert.AreEqual(expectedChange, actualChange);
        }
예제 #2
0
        private void btnDispenseChange_Click(object sender, EventArgs e)
        {
            if (_transactionHandler.AvailableFunds > 0)
            {
                var change = _transactionHandler.DispenseChange();
                UpdateCurrentPayment();
                SetStatus();

                MessageBox.Show(change.ToString("C"), "Here's your change. :)");
            }
        }