JavaNaming: Difference between revisions

From EggeWiki
No edit summary
 
No edit summary
Line 2: Line 2:


<pre>
<pre>
  public void testWhenTheCustomersBankAccountReachesZeroGetStatusReturns_NoAvailableFunds_unlessOfCourseTheAccountIsClosed_ifTheAccountIsClosedThenItShouldReturn_AccountClosed_() {
public void testWhenTheCustomersBankAccountReachesZeroGetStatusReturns_NoAvailableFunds_unlessOfCourseTheAccountIsClosed_ifTheAccountIsClosedThenItShouldReturn_AccountClosed_() {
       assertEquals("No Available Funds", fixture.getAccountWithZeroBalance().getStatus());
       assertEquals("No Available Funds", fixture.getAccountWithZeroBalance().getStatus());
       assertEquals("Account closed", fixture.getAccountWhichIsClosed().getStatus());
       assertEquals("Account closed", fixture.getAccountWhichIsClosed().getStatus());
}
}
</pre>
</pre>

Revision as of 22:27, 5 June 2007

theInventionOfCamelCaseNamingHasBeenAGreatHelpToJavaProgrammers_IHaveFoundItUsefulInAllMyJavaProgramsAndWouldLikeToProposeASlightExtensionToTheStandard_youSee_SometimesYouHaveAMethodOrVariableNameWhichRequiresMoreThanOneSentenceToDescribe_inSuchCases_IProposeReplacingThePeriodAtTheEndOfTheSentenceWithAnUnderscore_additionally_theUnderscoreCharacterCanBeUsedToReplaceOtherPunctuation_suchAsCommas_furthermoreIProposeUsingTwoUnderscoresToCreateANewParagraph__theseNewChangesWillBeMostUsefulForJavaProgrammersWhoLikeToGiveMethodNamesVeryDescriptiveNames_forExample_

public void testWhenTheCustomersBankAccountReachesZeroGetStatusReturns_NoAvailableFunds_unlessOfCourseTheAccountIsClosed_ifTheAccountIsClosedThenItShouldReturn_AccountClosed_() {
      assertEquals("No Available Funds", fixture.getAccountWithZeroBalance().getStatus());
      assertEquals("Account closed", fixture.getAccountWhichIsClosed().getStatus());
}