예제 #1
0
        public virtual IExerciceChoice ChooseAndShow(EExercice exercice)
        {
            IExerciceChoice choice = null;

            switch (exercice)
            {
            case EExercice.Exercice_1:
                choice = new Exercice_1();
                break;

            case EExercice.Exercice_2:
                choice = new Exercice_2();
                break;

            case EExercice.Exercice_3:
                choice = new Exercice_3();
                break;

            case EExercice.Exercice_4:
                choice = new Exercice_4();
                break;

            case EExercice.Exercice_5:
                choice = new Exercice_5();
                break;

            case EExercice.Quit:
            default: break;
            }

            return(choice);
        }
예제 #2
0
        public void run_fourth_exercice_should_be_type_of_address()
        {
            Exercice_4 fourthExercise = new Exercice_4();
            var        addressList    = fourthExercise.RunExercice();

            Assert.AreEqual(typeof(IEnumerable <AddressDTO>), addressList);
        }
예제 #3
0
        public void run_fourth_exercice_should_select_addresses()
        {
            Exercice_4        fourthExercise = new Exercice_4();
            List <AddressDTO> addressList    = fourthExercise.RunExercice() as List <AddressDTO>;
            var addressIds = fourthExercise.AddressIds;

            var addressListFromTestRepository = _testRepostory.GetAddressByIds(addressIds);

            Assert.NotNull(addressList);
            CollectionAssert.AreEqual(addressList.OrderBy(x => x.Id), addressListFromTestRepository.OrderBy(x => x.Id), new AddressDTOComparer());
            Assert.AreEqual(addressList.Count, addressListFromTestRepository.Count);
        }