Exemplo n.º 1
0
        public void executeContentTest()
        {
            objCity = new City("Starling");
            ThanksLetter objThanksLetter = new ThanksLetter(new Sender(objCity.listHabitant[0]), new Receiver(objCity.listHabitant[1]), "bla bla");

            objThanksLetter.executeContent();
        }
Exemplo n.º 2
0
        public void executeContentTest()
        {
            objCity = new City("Starling");

            Acknowledgment objAcknowledgment = new Acknowledgment(new Sender(objCity.listHabitant[0]), new Receiver(objCity.listHabitant[1]), "bla bla");
            objAcknowledgment.executeContent();
        }
Exemplo n.º 3
0
        public void executeContentTest()
        {
            objCity = new City("Starling");
            UrgentLetter objUrgentLetter = new UrgentLetter(new Sender(objCity.listHabitant[0]), new Receiver(objCity.listHabitant[1]), new SimpleLetter(new Sender(objCity.listHabitant[0]), new Receiver(objCity.listHabitant[1]), "bla bla"));

            objUrgentLetter.executeContent();
        }
Exemplo n.º 4
0
        public void sendLetterTest()
        {
            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());
        }
Exemplo n.º 5
0
        public void createUrgentLetterTest()
        {
            objCity = new City("Starling");

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

            Assert.AreEqual(1, objCity.getNumberOfLetter());
            Assert.AreEqual("an urgent letter", objCity.objPostBox.listCourrierReceive[0].getDescription());
        }
Exemplo n.º 6
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());
        }
Exemplo n.º 7
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());
        }
Exemplo n.º 8
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());
        }
Exemplo n.º 9
0
        City hisCity; //City where lives this habitant

        #endregion Fields

        #region Constructors

        public Inhabitant(City prmHisCity, int prmNumber)
        {
            objBankAccount = new BankAccount();
            hisCity = prmHisCity;
            number = prmNumber;
        }
Exemplo n.º 10
0
        public static void Main(string[] args)
        {
            //* Pour effectuer les tests
            City objCity = new City("Straling");
            Console.WriteLine("Mailing letters for 6 days");

            //DAY 1
            Console.WriteLine("************************************************************");
            Console.WriteLine("Day 1");
            objCity.listHabitant[16].createUrgentLetter(objCity.listHabitant[0], new SimpleLetter(new Sender(objCity.listHabitant[16]), new Receiver(objCity.listHabitant[0]), "bla bla")) ;
            objCity.listHabitant[34].createSimpleLetter(objCity.listHabitant[9], "bla bla");
            objCity.listHabitant[45].createPromissoryNote(objCity.listHabitant[8], 18);
            objCity.listHabitant[86].createPromissoryNote(objCity.listHabitant[49], 94);
            objCity.listHabitant[34].createSimpleLetter(objCity.listHabitant[24], "bla bla");

            //DAY 2
            Console.WriteLine("************************************************************");
            Console.WriteLine("Day 2");
            objCity.distributeLetters();
            objCity.listHabitant[86].createPromissoryNote(objCity.listHabitant[27], 731);
            objCity.listHabitant[61].createRegisteredLetter(objCity.listHabitant[54], new SimpleLetter(new Sender(objCity.listHabitant[61]), new Receiver(objCity.listHabitant[54]), "bla bla"));
            objCity.listHabitant[32].createUrgentLetter(objCity.listHabitant[40], new RegisteredLetter(new Sender(objCity.listHabitant[32]), new Receiver(objCity.listHabitant[40]), new SimpleLetter(new Sender(objCity.listHabitant[32]), new Receiver(objCity.listHabitant[40]), "bla bla")));

            //DAY 3
            Console.WriteLine("************************************************************");
            Console.WriteLine("Day 3");
            objCity.distributeLetters();
            objCity.listHabitant[23].createSimpleLetter(objCity.listHabitant[5], "bla bla");
            objCity.listHabitant[65].createSimpleLetter(objCity.listHabitant[88], "bla bla");
            objCity.listHabitant[34].createUrgentLetter(objCity.listHabitant[52], new SimpleLetter(new Sender(objCity.listHabitant[34]), new Receiver(objCity.listHabitant[52]), "bla bla"));

            //DAY 4
            Console.WriteLine("************************************************************");
            Console.WriteLine("Day 4");
            objCity.distributeLetters();
            objCity.listHabitant[38].createSimpleLetter(objCity.listHabitant[54], "bla bla");
            objCity.listHabitant[21].createUrgentLetter(objCity.listHabitant[55], new RegisteredLetter(new Sender(objCity.listHabitant[21]), new Receiver(objCity.listHabitant[55]), new PromissoryNote(new Sender(objCity.listHabitant[21]), new Receiver(objCity.listHabitant[55]), 714)));
            objCity.listHabitant[46].createUrgentLetter(objCity.listHabitant[10], new PromissoryNote(new Sender(objCity.listHabitant[46]), new Receiver(objCity.listHabitant[10]), 128));

            //DAY 5
            Console.WriteLine("************************************************************");
            Console.WriteLine("Day 5");
            objCity.distributeLetters();
            objCity.listHabitant[43].createSimpleLetter(objCity.listHabitant[35], "bla bla");
            objCity.listHabitant[75].createUrgentLetter(objCity.listHabitant[10], new RegisteredLetter(new Sender(objCity.listHabitant[75]), new Receiver(objCity.listHabitant[10]), new SimpleLetter(new Sender(objCity.listHabitant[75]), new Receiver(objCity.listHabitant[10]), "bla bla")));
            objCity.listHabitant[56].createPromissoryNote(objCity.listHabitant[52], 296);

            //DAY 6
            Console.WriteLine("************************************************************");
            Console.WriteLine("Day 6");
            objCity.distributeLetters();
            objCity.listHabitant[62].createRegisteredLetter(objCity.listHabitant[41], new SimpleLetter(new Sender(objCity.listHabitant[62]), new Receiver(objCity.listHabitant[41]), "bla bla"));
            objCity.listHabitant[59].createRegisteredLetter(objCity.listHabitant[1], new SimpleLetter(new Sender(objCity.listHabitant[59]), new Receiver(objCity.listHabitant[1]), "bla bla"));

            //DAY 7
            Console.WriteLine("************************************************************");
            Console.WriteLine("Day 7");
            objCity.distributeLetters();

            //DAY 8
            Console.WriteLine("************************************************************");
            Console.WriteLine("Day 8");
            objCity.distributeLetters();

            //DAY 9
            Console.WriteLine("************************************************************");
            Console.WriteLine("Day 9");
            objCity.distributeLetters();

            int i = 0;
            i = i + 1;

            //*/
        }
Exemplo n.º 11
0
        public void getCityTest()
        {
            objCity = new City("Starling");

            City checkCity = objCity.listHabitant[0].getCity();

            Assert.IsNotNull(checkCity);
            Assert.AreEqual("Starling", checkCity.getNameCity());
        }
Exemplo n.º 12
0
        public void InhabitantTest()
        {
            objCity = new City("Starling");

            Assert.AreEqual(100, objCity.getNumberOfInhabitants());
        }
Exemplo n.º 13
0
 public void getNameCityTest()
 {
     objCity = new City("Starling");
     Assert.AreEqual("Starling", objCity.getNameCity());
 }
Exemplo n.º 14
0
 public void CityTest()
 {
     objCity = new City("Starling");
     Assert.IsNotNull(objCity);
 }