public async Task <IActionResult> DeleteConfirmed(long id)
        {
            var specialty = await _specialtyService.GetSpecialty(id);

            await _specialtyService.DeleteSpecialty(specialty);

            return(RedirectToAction(nameof(Index)));
        }
Esempio n. 2
0
        public async Task DeleteSpecialtyTest()
        {
            var fakeRepository   = Mock.Of <ISpecialtyRepository>();
            var specialtyService = new SpecialtyService(fakeRepository);

            var specialty = new Specialty()
            {
                Id = 1, Name = "test"
            };

            await specialtyService.CreateSpecialty(specialty);

            await specialtyService.DeleteSpecialty(specialty);

            Assert.Null(await specialtyService.GetSpecialty(1));
        }