Ejemplo n.º 1
0
        public async Task UpdateStudent_Success()
        {
            var student = _universityDbContext.Students.Add(new Student()
            {
                FirstName = "Name", LastName = "Original"
            });

            _universityDbContext.SaveChanges();

            var x = await _studentRepository.ChangeLastName(student.Id, "New");

            var updatedStudent = _universityDbContext.Students.AsNoTracking().FirstOrDefault(s => s.Id.Equals(student.Id));

            Assert.IsNotNull(updatedStudent);
            Assert.AreEqual("New", updatedStudent.LastName);
        }