コード例 #1
0
ファイル: ThanksLetterTests.cs プロジェクト: ALefaux/Courrier
        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();
        }
コード例 #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();
        }
コード例 #3
0
ファイル: UrgentLetterTests.cs プロジェクト: ALefaux/Courrier
        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();
        }
コード例 #4
0
ファイル: CityTests.cs プロジェクト: ALefaux/Courrier
        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());
        }
コード例 #5
0
ファイル: InhabitantTests.cs プロジェクト: ALefaux/Courrier
        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());
        }
コード例 #6
0
ファイル: InhabitantTests.cs プロジェクト: ALefaux/Courrier
        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());
        }
コード例 #7
0
ファイル: InhabitantTests.cs プロジェクト: ALefaux/Courrier
        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());
        }
コード例 #8
0
ファイル: InhabitantTests.cs プロジェクト: ALefaux/Courrier
        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());
        }
コード例 #9
0
ファイル: Inhabitant.cs プロジェクト: ALefaux/Courrier
        City hisCity; //City where lives this habitant

        #endregion Fields

        #region Constructors

        public Inhabitant(City prmHisCity, int prmNumber)
        {
            objBankAccount = new BankAccount();
            hisCity = prmHisCity;
            number = prmNumber;
        }
コード例 #10
0
ファイル: Program.cs プロジェクト: ALefaux/Courrier
        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;

            //*/
        }
コード例 #11
0
ファイル: InhabitantTests.cs プロジェクト: ALefaux/Courrier
        public void getCityTest()
        {
            objCity = new City("Starling");

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

            Assert.IsNotNull(checkCity);
            Assert.AreEqual("Starling", checkCity.getNameCity());
        }
コード例 #12
0
ファイル: InhabitantTests.cs プロジェクト: ALefaux/Courrier
        public void InhabitantTest()
        {
            objCity = new City("Starling");

            Assert.AreEqual(100, objCity.getNumberOfInhabitants());
        }
コード例 #13
0
ファイル: CityTests.cs プロジェクト: ALefaux/Courrier
 public void getNameCityTest()
 {
     objCity = new City("Starling");
     Assert.AreEqual("Starling", objCity.getNameCity());
 }
コード例 #14
0
ファイル: CityTests.cs プロジェクト: ALefaux/Courrier
 public void CityTest()
 {
     objCity = new City("Starling");
     Assert.IsNotNull(objCity);
 }