First, "setBalance" is a bad name for a variable. It sounds like a method name, and then you have "setSetBalance" as your method. Just remove one of the sets from each of these.
This method does nothing. And setBalance is initialized to the double 10. So, this test:
Expects that the balance will be 1.0 but it gets 10, since nothing ever changes it.
initialAmount is the passed in argument, and setBalance is the global variable. So, you are setting the argument to the global variable, then the argument goes away, so this method also does not affect the balance.
This test should be passing even though the openAccount(double) method is incorrect, because the balance variable is initialized to 10 anyways. This isn't a well written test for that reason.
This method also does nothing
This test expects the balance to be 0.0, but it's initialized to 10 and nothing ever changes it.
Joffrey Williams wrote:My getAccountBalance() method has to read the openAccount() and openAccount(double initialAmount) method separatly. but its seems to be reading 1 at a time.
I don't know what you mean by this. Both those openAccount methods are declared to have void return value so I don't see how you can expect getAccountBalance() to "read" anything from them, whatever that's supposed to mean.
That statement doesn't make sense even if we translate "read" to "call" because why would you have getAccountBalance() call the openAccount() methods?
Can you describe what you're expecting to see and what you think you see in different terms?
As for your tests, they are saying to me:
Test on line 6 - calling openAccount() results in a default balance of 1.0
Test on line 11 - calling openAccount(double initialAmount) results in a balance of initialAmount
Test on line 17 - calling openAccount() then immediately closeAccount() results in a balance of 0.0
These seem reasonable enough to me. It's the implementation that's being tested that looks like it was purposely written to make those tests fail. Seems like the exercise was to fix the code so that the tests pass. If that implementation was something you wrote, then it's obviously wrong, as pointed out in detail in the previous responses given.