For this purpose we’ll use a simple queue but there are many other options in creating a log feature. First create the Queue. Now update the Balance property to log when the value is set. Finally we’ll create a method to return the log when called. Let’s jump back into the program and add a […]
Now what we need to do here is create our methods that interacts with the user to change the balance property inside our ATM class. We already created our add method so let’s add a method to withdraw from our balance. Wait a minute, what about if we don’t have any in our balance account? […]
So let’s test our method by writing a test. Since we create the instance of the ATM at runtime we would expect the balance to be whatever we pass as parameters. Now if we build this it should fail since we are telling our AreEqual that we are expecting a 3 to be returned. Now […]
Let’s check that our test works. Create a new class in the main project that will be an ATM object that will have a property for our balance. Now let’s create a method that adds to our balance and returns our updated balance. Perfect! Now in the next post we’ll test this method.