예제 #1
0
        public IActionResult Edit(int id, PaginationParameters paginationParameters)
        {
            StudentWithSchool    student              = _studentService.GetStudent(id);
            StudentViewModel     studentViewModel     = _mapper.Map <StudentWithSchool, StudentViewModel>(student);
            EditStudentViewModel editStudentViewModel = new EditStudentViewModel(studentViewModel, paginationParameters);

            return(View(editStudentViewModel));
        }
예제 #2
0
        public void EditStudent()
        {
            _testStudent.FirstName = "Павел";
            _studentService.Edit(_testStudent);
            StudentWithSchool editedStudent = _studentService.GetStudent(_testStudent.Id);

            Assert.AreEqual(_testStudent.FirstName, editedStudent.FirstName);
        }
예제 #3
0
        public void NoPatronymic()
        {
            _testStudent.Patronymic = String.Empty;
            _studentService.Edit(_testStudent);
            StudentWithSchool editedStudent = _studentService.GetStudent(_testStudent.Id);

            Assert.AreEqual(_testStudent.FirstName, editedStudent.FirstName);
        }
예제 #4
0
        public void NoLastName()
        {
            _testStudent.LastName = null;
            _studentService.Edit(_testStudent);
            StudentWithSchool editedStudent = _studentService.GetStudent(_testStudent.Id);

            Assert.AreEqual(_testStudent.FirstName, editedStudent.FirstName);
        }
예제 #5
0
 public void TooBigLastName()
 {
     _testStudent.LastName = _51LengthStr;
     _studentService.Edit(_testStudent);
     StudentWithSchool editedStudent = _studentService.GetStudent(_testStudent.Id);
 }
예제 #6
0
 public void NoFirstName()
 {
     _testStudent.FirstName = String.Empty;
     _studentService.Edit(_testStudent);
     StudentWithSchool editedStudent = _studentService.GetStudent(_testStudent.Id);
 }
예제 #7
0
 public void PhoneLittleNumbers()
 {
     _testStudent.Phone = "12345";
     _studentService.Edit(_testStudent);
     StudentWithSchool editedStudent = _studentService.GetStudent(_testStudent.Id);
 }
예제 #8
0
 public void PhoneTooManyNumbers()
 {
     _testStudent.Phone = "1234567890111";
     _studentService.Edit(_testStudent);
     StudentWithSchool editedStudent = _studentService.GetStudent(_testStudent.Id);
 }
예제 #9
0
 public void PhoneNotNumbers()
 {
     _testStudent.Phone = "abcabcabcd";
     _studentService.Edit(_testStudent);
     StudentWithSchool editedStudent = _studentService.GetStudent(_testStudent.Id);
 }
예제 #10
0
 public void TooBigPatronymic()
 {
     _testStudent.Patronymic = _51LengthStr;
     _studentService.Edit(_testStudent);
     StudentWithSchool editedStudent = _studentService.GetStudent(_testStudent.Id);
 }