예제 #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 RunExerciceMethodShouldReturnEmployeeDTOTypeObject()
        {
            Exercice_1 _firstExercice = new Exercice_1();
            var        _employee      = _firstExercice.RunExercice();
            var        _employeeType  = _employee.GetType();

            Assert.AreEqual(typeof(EmployeeDTO), _employeeType);
        }
예제 #3
0
        public void RunExerciceMethodShouldReturnExactlyOneRealObjectFromEmployeeTableDapperDBWithAllEntityProperties()
        {
            Exercice_1  _firstExercice  = new Exercice_1();
            EmployeeDTO _employee       = _firstExercice.RunExercice() as EmployeeDTO;
            var         _employeeList   = new TestRepository(ConnectionStore.ConnectionString).GetAllEmployees();
            var         _containsResult = _employeeList
                                          .Any(x => x.AddressId == _employee.AddressId &&
                                               x.Id == _employee.Id &&
                                               x.FirstName == _employee.FirstName &&
                                               x.LastName == _employee.LastName);

            Assert.IsTrue(_containsResult);
        }