# Bank Account Simulate a bank account supporting opening/closing, withdrawals, and deposits of money. Watch out for concurrent transactions! A bank account can be accessed in multiple ways. Clients can make deposits and withdrawals using the internet, mobile phones, etc. Shops can charge against the account. Create an account that can be accessed from multiple threads/processes (terminology depends on your programming language). It should be possible to close an account; operations against a closed account must fail. ## Instructions Run the test file, and fix each of the errors in turn. When you get the first test to pass, go to the first pending or skipped test, and make that pass as well. When all of the tests are passing, feel free to submit. Remember that passing code is just the first step. The goal is to work towards a solution that is as readable and expressive as you can make it. Have fun! ## Test-Driven Development As programmers mature, they eventually want to test their code. Here at Exercism we simulate [Test-Driven Development](http://en.wikipedia.org/wiki/Test-driven_development) (TDD), where you write your tests before writing any functionality. The simulation comes in the form of a pre-written test suite, which will signal that you have solved the problem. It will also provide you with a safety net to explore other solutions without breaking the functionality. ### A typical TDD workflow on Exercism: 1. Run the test file and pick one test that's failing. run `groovy BankAccountSpec.groovy` 2. Write some code to fix the test you picked. (Modify `BankAccount.groovy`) 3. Re-run the tests to confirm the test is now passing. 4. Repeat from step 1. 5. Submit your solution (`exercism submit /path/to/file`) ## Instructions Submissions are encouraged to be general, within reason. Having said that, it's also important not to over-engineer a solution. It's important to remember that the goal is to make code as expressive and readable as we can. For installation and learning resources, refer to the [exercism help page](http://exercism.io/languages/groovy). Run the tests by executing the test script. ``` $ groovy ./BankAccountSpec.groovy ``` After the first test(s) pass, continue by commenting out or removing the `@Ignore` annotations prepending other tests. When all tests pass, congratulations! ## Source This is an exercise to introduce users to basic programming constructs, just after hello World. [https://en.wikipedia.org/wiki/Two-fer](https://en.wikipedia.org/wiki/Two-fer) ## Submitting Incomplete Solutions It's possible to submit an incomplete solution so you can see how others have completed the exercise.