@@ -0,0 +1,1777 @@
+package Person.test.mock;%0A%0Aimport Person.PersonAgent;%0Aimport Person.PersonAgent.PersonState;%0Aimport junit.framework.*;%0Apublic class PersonTest2 extends TestCase%7B%0A%09%0A%09%09PersonAgent pa;%0A%09%09PersonAgent pa2;%0A%09%09%0A%09%09%0A%09%09public void setUp() throws Exception%7B%0A%09%09%09super.setUp();%0A%09%09%09pa = new PersonAgent(%22TestPerson1%22);%0A%09%09%09pa2= new PersonAgent(%22TestPerson2%22);%0A%09%09%7D%0A%09%09public void testInitialization() %7B%0A%09%09%09assertTrue(%22State of customer initially be Idle%22, pa.state==PersonState.Idle);%0A%09%09%09System.out.println(%22Testing all the transactions which involve money/loans and if the SSN algorithm works correctly%22);%0A    %09    assertEquals(%22The person should have 100 dollars initially%22,pa.getMoney(),100.00);%0A    %09    pa.setMoney(150);%0A    %09    assertEquals(%22The person should have 150 dollars now as I set that as the money%22,pa.getMoney(),150.00);%0A    %09    pa.setLoan(1000);%0A    %09    assertEquals(%22The person should have a loan of 1000 dollars%22,pa.getLoan(),1000.00);%0A    %09    pa.msgReceiveSalary(1000);%0A    %09    assertEquals(%22The person should have 150+1000 dollars now%22,pa.getMoney(),1150.00);%0A    %09    pa.msgPayBackLoanUrgently();%0A    %09    assertTrue(%22State of customer should be PayLoanNow%22, pa.state==PersonState.PayLoanNow);%0A    %09    pa.msgPayBackRentUrgently();%0A    %09    assertTrue(%22State of customer should be PayLoanNow%22, pa.state==PersonState.PayRentNow);%0A    %09    //checking SSNs%0A    %09    assertTrue(%22SSN of person 1 should be 0%22, pa.getSSN()==0);%0A    %09    assertTrue(%22SSN of person 2 should be 1%22, pa2.getSSN()==1);%0A    %09    %0A    %09    pa.msgINeedMoney(100);%0A    %09    assertTrue(%22State of customer should be NeedsMoney%22, pa.state==PersonState.NeedsMoney);%0A    %09    assertEquals(%22The person should need 100 dollars now%22,pa.getMoneyNeeded(),100.00);%0A    %09    %0A    %09   %0A    %09    %0A%09%09%7D%0A%09%09%0A%09%09%0A%09%7D%0A%0A%0A

Test for the monetary transactions and the SSN algorithm