Package model.entities

Examples of model.entities.CPerson


    }

    @Test
    public void testRemoveCouple() throws Exception {
        registry.addCouple(p1, p2);
        registry.addCouple(new CPerson("bob", 44, ESex.Male), new CPerson("sally", 40, ESex.Female));
        assertTrue(registry.removeCouple(p1, p2));
        assertTrue(registry.removeCouple(new CPerson("bob", 44, ESex.Male), new CPerson("sally", 40, ESex.Female)));
        assertFalse(registry.removeCouple(p1, p2));
    }
View Full Code Here


    }

    @Test
    public void testIsCoupleMarriageEligible() throws Exception {
        assertTrue(registry.isCoupleMarriageEligible(p1, p2));
        assertFalse(registry.isCoupleMarriageEligible(new CPerson("youngin", 17, ESex.Female),
                new CPerson("yup", 18, ESex.Male)));
        registry.addCouple(p1, p2);
        assertFalse(registry.isCoupleMarriageEligible(p1, p2));
        registry.removeCouple(p1, p2);
        registry.addCouple(p1, new CPerson("cindy", 20, ESex.Female));
        assertFalse(registry.isCoupleMarriageEligible(p1, p2));
    }
View Full Code Here

    @Test
    public void testIsPersonAdult() throws Exception {
        assertTrue(registry.isPersonAdult(p1));
        assertTrue(registry.isPersonAdult(p2));
        assertFalse(registry.isPersonAdult(new CPerson("test", 17, ESex.Male)));
    }
View Full Code Here

            if(words.length == 3) {
                try {
                    if(Integer.parseInt(words[1]) > 0 &&
                            (words[2].toLowerCase().equals("male") || words[2].toLowerCase().equals("female"))) {
                        ESex sex = words[2].toLowerCase().equals("male") ? ESex.Male : ESex.Female;
                        mService.addNewSingle(new CPerson(words[0], Integer.parseInt(words[1]), sex));
                    }
                } catch(NumberFormatException n) {
                    System.out.println(n.toString());
                    continue;
                }
View Full Code Here

            if(line.equals("-1")) {
                return;
            }
            String[] words = line.split(" ");
            if(words.length == 2) {
                CPerson p1 = mService.findPerson(words[0]);
                CPerson p2 = mService.findPerson(words[1]);
                mService.marryCouple(p1, p2);
            }
        }
    }
View Full Code Here

            if(line.equals("-1")) {
                return;
            }
            String[] words = line.split(" ");
            if(words.length == 2) {
                CPerson p1 = mService.findPerson(words[0]);
                CPerson p2 = mService.findPerson(words[1]);
                mService.divorceCouple(p1, p2);
            }
        }
    }
View Full Code Here

TOP

Related Classes of model.entities.CPerson

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.