Esempio n. 1
0
 public StudentController(IStudentManager studentManager, IMapper mapper, IDepartmentManager departmentManager, IUtilityManager utilityManager)
 {
     _studentManager    = studentManager;
     _mapper            = mapper;
     _departmentManager = departmentManager;
     _utilityManager    = utilityManager;
 }
 /// <summary>
 /// 构造函数
 /// </summary>
 public StudentAppService(IRepository <Student, int> studentRepository
                          , IStudentManager studentManager
                          )
 {
     _studentRepository = studentRepository;
     _studentManager    = studentManager;
 }
Esempio n. 3
0
        public StudentControllerTests()
        {
            _logger = new Mock <ILogger <StudentController> >().Object;

            _students = new List <Student>()
            {
                new Student()
                {
                    Id = 1, FirstName = "test1first"
                },
                new Student()
                {
                    Id = 2, FirstName = "test2first"
                }
            };
            var mockManager = new Mock <IStudentManager>();

            mockManager
            .Setup(m => m.GetStudents())
            .Returns(() => Task.FromResult(_students.AsEnumerable()));
            _manager = mockManager.Object;

            var mockURL = new Mock <IUrlHelper>(); //Have to mock this because of the logic in the controller that creates links

            mockURL
            .Setup(m => m.Link(It.IsAny <string>(), It.IsAny <object>()))
            .Returns("/fake/link");

            _controller     = new StudentController(_logger, _manager);
            _controller.Url = mockURL.Object;
        }
        // GET: Students/Details/5
        public async Task <IActionResult> Details(
            [FromServices] IStudentManager /*LAB6 - как параметр экшена контроллера*/ studentManager,
            int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }


            var student = await _context.Students

                          .Include(s => s.Enrollments)
                          .ThenInclude(e => e.Course)
                          .AsNoTracking()
                          .SingleOrDefaultAsync(m => m.ID == id);

            if (student == null)
            {
                return(NotFound());
            }


//            var sInfo = _studentManager.GetStudentInfo(student);
            var sInfo = studentManager.GetStudentInfo(student);

            return(View(student));
        }
        //private IMapper _mapper;



        public CourseEnrollToStudentController(ICourseEnrollToStudentManager courseEnrollToStudentManager, IStudentManager studentManager, ICourseManager courseManager, IDepartmentManager departmentManager /* IMapper mapper*/)
        {
            _courseEnrollToStudentManager = courseEnrollToStudentManager;
            _studentManager    = studentManager;
            _courseManager     = courseManager;
            _departmentManager = departmentManager;
            //_mapper = mapper;
        }
Esempio n. 6
0
        public StudentController(
            ILogger <StudentController> logger,
            IStudentManager studentManager)
        {
            _logger = logger;

            _studentManager = studentManager;
        }
Esempio n. 7
0
 public AdminController(IGraphManager graphManager,
                        IStudentManager studentManager,
                        IPsychologistManager psychologistManager)
 {
     _graphManager        = graphManager;
     _studentManager      = studentManager;
     _psychologistManager = psychologistManager;
 }
Esempio n. 8
0
 public AddingStudentTests()
 {
     _mapperMock     = new Mock <IMapper>();
     _studentManager = new StudentManager(
         new CourseRepositoryMock(),
         new StudentRepositoryMock(),
         _mapperMock.Object);
 }
 public MainScreenViewModel(IStudentManager studentManager,
     [ImportMany] IEnumerable<Lazy<IEmailManager, IEmailManagerCapabilities>> emailManagers)
 {
     _displayName = "Practicum Emailer";
     _cutOff = DateTime.Now;
     _studentManager = studentManager;
     _emailManagers = emailManagers;
     _selectedEmailHandler = _emailManagers.First().Metadata.Handler;
 }
 public StudentResultController(IStudentResultManager studentResultManager, IStudentManager studentManager, IGradePointManager gradePointManager, ICourseManager courseManager, ICourseEnrollToStudentManager courseEnrollToStudentManager, IMapper mapper)
 {
     _studentResultManager         = studentResultManager;
     _studentManager               = studentManager;
     _gradePointManager            = gradePointManager;
     _courseManager                = courseManager;
     _courseEnrollToStudentManager = courseEnrollToStudentManager;
     _mapper = mapper;
 }
 public LessonForStudentManager(
     IObsNetRepository <LessonForStudent> repository,
     IStudentManager student,
     ILessonManager lesson
     )
 {
     _lesson     = lesson;
     _student    = student;
     _repository = repository;
 }
Esempio n. 12
0
 public StudentController(ILogger <StudentController> logger,
                          IStudentManager studentManager,
                          IOptionManager optionManager,
                          IMapper mapper)
 {
     _logger         = logger;
     _mapper         = mapper;
     _studentManager = studentManager;
     _optionManager  = optionManager;
 }
Esempio n. 13
0
 protected BaseController(
     IStudentManager studentManager = null,
     UserManager userManager        = null,
     SignInManager signInManager    = null
     )
 {
     StudentManager = studentManager;
     UserManager    = userManager;
     SignInManager  = signInManager;
 }
Esempio n. 14
0
 protected BaseController(
     IStudentManager studentManager = null,
     UserManager userManager        = null,
     SignInManager signInManager    = null,
     IAuthenticationManager authenticationManager = null
     )
 {
     StudentManager        = studentManager;
     UserManager           = userManager;
     SignInManager         = signInManager;
     AuthenticationManager = authenticationManager;
 }
Esempio n. 15
0
        public async Task Minimum_yas_altindaki_ogrenciler_kaydedildiginde_result_fail_donmeli()
        {
            // TODO : sadece ilgilendiğimiz parametreleri doldursak olmazmıydı
            //Arrange
            var studentBlDto = new StudentBlDto
            {
                BirthDate = new DateTime(2003, 01, 01),
                FirstName = "Murat",
                LastName  = "Çabuk",
                Gender    = "Male",
                StudentId = "123456",
                Age       = 17
            };

            var student = new Student
            {
                BirthDate = new DateTime(2003, 01, 01),
                FirstName = "Murat",
                LastName  = "Çabuk",
                Gender    = "Male",
                StudentId = "123456"
            };

            mapperMock.Setup(t => t.Map <Student>(studentBlDto)).Returns(student);

            asyncStudentRespositoryMock.Setup(t => t.Insert(student));

            dateTimeProviderMock.Setup(t => t.GetTodayDateTime())
            .ReturnsAsync(() => new DateTime(2020, 01, 01));

            sutStudentManager = new StudentManager(asyncStudentRespositoryMock.Object,
                                                   mapperMock.Object,
                                                   dateTimeProviderMock.Object,
                                                   cacheMock.Object);

            var studentAddUpdateModel = new StudentAddUpdateModel
            {
                Student = studentBlDto
            };

            //Act
            var result = await sutStudentManager.Add(studentAddUpdateModel);

            var count = result.SpecResult.FailedSpecifications.ToFilteredSpecs(nameof(StudentBlDto.BirthDate)).Count;

            //Assert
            Assert.True(count > 0);


            // TODO : şu şekilde yapsaydık olmazmıydı
            // Assert.False(result.IsOk);
        }
Esempio n. 16
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            var displayType = new DisplayType();

            // on compile type, T is replaced with actual type
            var displayTypeV2 = new DisplayTypeV2 <Student>();

            displayTypeV2.DisplayTypeFor(new Student());

            var displayTypeV2a = new DisplayTypeV2 <string>();

            displayTypeV2a.DisplayTypeFor("data");

            // database manager usage

            IStudentManager   studentManager   = null;
            IProfessorManager professorManager = null;
            IDirectorManager  directorManager  = null;

            IDatabaseManager <Student>        studentManager2          = null;
            IDatabaseManager <Professor>      professorManager2        = null;
            IDatabaseManager <Director>       directorManager2         = null;
            IDatabaseManager <SuperProfessor> superProfDatabaseManager = null;

            // generic at class level vs method level
            var dtv2a = new DisplayTypeV2 <Student>();

            dtv2a.DisplayTypeFor(new Student());

            var dtv2b = new DisplayTypeV2 <string>();

            dtv2b.DisplayTypeFor("data");


            var dtv3 = new DisplayTypeV3();

            dtv3.DisplayTypeFor <Student>(new Student());
            dtv3.DisplayTypeFor <string>("data");

            // multimple T
            var mt = new DisplayTypeV4 <string, int>();
        }
Esempio n. 17
0
        public Parser(string file, bool? test, IEmailManager emailManager,
            IStudentManager studentManager)
        {
            try
            {
                _excelFactory = new ExcelQueryFactory(file);
            }
            catch (IOException e)
            {
                throw;
            }

            _emailManager = emailManager;
            _studentManager = studentManager;
            _students = new Dictionary<string, Domain.Student>();
            _myOutlook = new Application();
            _isTest = test;

            _studentTask = Task.Factory.StartNew(PopulateStudents);
        }
Esempio n. 18
0
        public void StudentAgeValidation()
        {
            var container = unityContainer.GetBusinessServiceTestUnityContainer();

            container.RegisterType <IStudentRepository, StudentRepositoryDummy>();

            IStudentManager studentManager = container.Resolve <IStudentManager>();

            Student testStudent = new Student()
            {
                FirstName = "TestName",
                DOB       = DateTime.Today //.AddYears(-24)
            };

            bool result = studentManager.AddStudent(testStudent);

            Assert.IsFalse(result);

            // return true;
        }
Esempio n. 19
0
        static void Main(string[] args)
        {
            Console.WriteLine("Load Operation - Enter a File Path (e.g Input.csv):");
            string szLine = Console.ReadLine();

            IFileFactory fileFactory = new FileFactory();
            IHandleFile  handleFile  = fileFactory.GetFileType("CSV");

            IStudentRepository oRepo    = null;
            IStudentManager    oManager = null;

            try
            {
                handleFile.Path = szLine;
                oRepo           = new StudentRepository(handleFile.Read());
                oManager        = new StudentManager(oRepo, handleFile);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Cannot load the CSV file");
            }

            if (oManager != null)
            {
                Console.WriteLine("Search Operation - Enter a command (e.g name=ana type=kinder");
                szLine = Console.ReadLine();
                Print(oManager.Search(szLine));
            }


            Console.WriteLine("Create Operation - Enter file path (e.g create.csv");
            szLine = Console.ReadLine();
            oManager.Save(handleFile.Read(szLine));
            oManager.Sync();
            Print(oRepo.GetContext());


            Console.Read();
        }
Esempio n. 20
0
 public AccountController(IUserHelper userHelper, IMailHelper mailHelper, IStudentManager studentManager)
 {
     this.userHelper     = userHelper;
     this.mailHelper     = mailHelper;
     this.studentManager = studentManager;
 }
 public StudentsController(SchoolDbContext context)
 {
     _studentManager = new StudentManager(context);
 }
Esempio n. 22
0
 public StudentsController(IStudentManager studentManager)
 {
     _studentManager = studentManager;
 }
 public StudentsController(IStudentManager studManager, IGroupManager groupManager)
 {
     this.studManager  = studManager;
     this.groupManager = groupManager;
 }
 public StudentController(IStudentManager student)
 {
     _student = student;
 }
 public StudentController()
 {
     _aManager = new StudentManager();
 }
 public StudentController(IStudentManager studentManager, IDepartmentManager departmentManager, IMapper mapper)
 {
     _departmentManager = departmentManager;
     _studentManager    = studentManager;
     _mapper            = mapper;
 }
Esempio n. 27
0
 public StudentTextParser(IGroupManager groupManager, IStudentManager studentManager)
 {
     GroupManager = groupManager;
     StudentManager = studentManager;
     Columns = new List<Column>() { Index, FirstName, SecondName, FatherName, Group, Course };
 }
 public StudentController(IStudentManager manager)
 {
     this._manager = manager;
 }
Esempio n. 29
0
 public MainMenuController(ISubjectManager subjectManager, IStudentManager studentManager)
 {
     this._subjectManager = subjectManager;
     this._studentManager = studentManager;
 }
Esempio n. 30
0
 public TestController(IUserManager userManager, IStudentManager studentManager)
 {
     _userManager    = userManager;
     _studentManager = studentManager;
 }
Esempio n. 31
0
 public StudentService(IStudentManager studentManager)
 {
     _studentManager = studentManager;
 }
Esempio n. 32
0
 public SignUpProcessorFunction(IStudentManager studentManager, IEmailSender emailSender)
 {
     _studentManager = studentManager;
     _emailSender    = emailSender;
 }
Esempio n. 33
0
 public AccountController(IStudentManager studentManager, IInstitutionManager institutionManager, ITeacherManager teacherManager)
 {
     this._studentManager = studentManager;
     this._institutionManager = institutionManager;
     this._teacherManager = teacherManager;
 }
Esempio n. 34
0
 public AdminController(IStudentManager studentManager, IGroupManager groupManager)
 {
     _studentManager = studentManager;
     _groupManager   = groupManager;
 }
 public StudentsController(IStudentManager context)
 {
     _context = context;
 }
Esempio n. 36
0
 public StudentManagerController(IStudentManager studentManager, IInstitutionManager institutionManager)
 {
     this._studentManager = studentManager;
     this._institutionManager = institutionManager;
 }