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)); }
public void EditStudent() { _testStudent.FirstName = "Павел"; _studentService.Edit(_testStudent); StudentWithSchool editedStudent = _studentService.GetStudent(_testStudent.Id); Assert.AreEqual(_testStudent.FirstName, editedStudent.FirstName); }
public void NoPatronymic() { _testStudent.Patronymic = String.Empty; _studentService.Edit(_testStudent); StudentWithSchool editedStudent = _studentService.GetStudent(_testStudent.Id); Assert.AreEqual(_testStudent.FirstName, editedStudent.FirstName); }
public void NoLastName() { _testStudent.LastName = null; _studentService.Edit(_testStudent); StudentWithSchool editedStudent = _studentService.GetStudent(_testStudent.Id); Assert.AreEqual(_testStudent.FirstName, editedStudent.FirstName); }
public void TooBigLastName() { _testStudent.LastName = _51LengthStr; _studentService.Edit(_testStudent); StudentWithSchool editedStudent = _studentService.GetStudent(_testStudent.Id); }
public void NoFirstName() { _testStudent.FirstName = String.Empty; _studentService.Edit(_testStudent); StudentWithSchool editedStudent = _studentService.GetStudent(_testStudent.Id); }
public void PhoneLittleNumbers() { _testStudent.Phone = "12345"; _studentService.Edit(_testStudent); StudentWithSchool editedStudent = _studentService.GetStudent(_testStudent.Id); }
public void PhoneTooManyNumbers() { _testStudent.Phone = "1234567890111"; _studentService.Edit(_testStudent); StudentWithSchool editedStudent = _studentService.GetStudent(_testStudent.Id); }
public void PhoneNotNumbers() { _testStudent.Phone = "abcabcabcd"; _studentService.Edit(_testStudent); StudentWithSchool editedStudent = _studentService.GetStudent(_testStudent.Id); }
public void TooBigPatronymic() { _testStudent.Patronymic = _51LengthStr; _studentService.Edit(_testStudent); StudentWithSchool editedStudent = _studentService.GetStudent(_testStudent.Id); }