Esempio n. 1
0
        public void distributeLettersTest()
        {
            objCity = new City("Starling");
            Letter objLetter = new SimpleLetter(new Sender(objCity.listHabitant[0]), new Receiver(objCity.listHabitant[1]), "bla bla");
            objCity.sendLetter(objLetter);

            Assert.AreEqual(1, objCity.getNumberOfLetter());

            objCity.distributeLetters();

            Assert.AreEqual(0, objCity.getNumberOfLetter());
        }
Esempio n. 2
0
        public void createThanksLetterTest()
        {
            objCity = new City("Starling");

            objCity.listHabitant[0].createThanksLetter(objCity.listHabitant[1], "bla bla");

            Assert.AreEqual(1, objCity.getNumberOfLetter());
            Assert.AreEqual("a thanks letter", objCity.objPostBox.listCourrierReceive[0].getDescription());
        }
Esempio n. 3
0
        public void createRegisteredLetterTest()
        {
            objCity = new City("Starling");

            objCity.listHabitant[0].createRegisteredLetter(objCity.listHabitant[1], new SimpleLetter(new Sender(objCity.listHabitant[0]), new Receiver(objCity.listHabitant[1]), "bla bla"));

            Assert.AreEqual(1, objCity.getNumberOfLetter());
            Assert.AreEqual("a registered letter", objCity.objPostBox.listCourrierReceive[0].getDescription());
        }
Esempio n. 4
0
        public void createPromissoryNoteTest()
        {
            objCity = new City("Starling");

            objCity.listHabitant[0].createPromissoryNote(objCity.listHabitant[1], 5);

            Assert.AreEqual(1, objCity.getNumberOfLetter());
            Assert.AreEqual("a promissory note letter", objCity.objPostBox.listCourrierReceive[0].getDescription());
        }
Esempio n. 5
0
        public void createAcknowledgmentTest()
        {
            objCity = new City("Starling");

            objCity.listHabitant[0].createAcknowledgment(objCity.listHabitant[1], "bla bla");

            Assert.AreEqual(1, objCity.getNumberOfLetter());
            Assert.AreEqual("an acknowledgment of receipt", objCity.objPostBox.listCourrierReceive[0].getDescription());
        }