public void Cleanup()
 {
     foreach (int skillId in _skillIdList)
     {
         var result = _skillController.DeleteSkill(skillId);
     }
 }
        public void DeleteSkillTest()
        {
            var skills     = skillsController.GetSkills().OrderByDescending(s => s.Skill_ID).FirstOrDefault();
            var skillsList = skillsController.DeleteSkill(skills.Skill_ID);

            Assert.IsNotNull(skillsList);
        }
        public async Task DeleteSkillTest()
        {
            // Arrange
            var repo       = new FakeSkillRepository(TestData.Skills());
            var controller = new SkillsController(repo, null);
            var skillId    = 1;

            // Act
            var result = await controller.DeleteSkill(skillId);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(skillId, result.Value.Id);
        }
        public async Task DeleteSkillNotFoundTest()
        {
            // Arrange
            var repo       = new FakeSkillRepository(TestData.Skills());
            var controller = new SkillsController(repo, null);
            var skillId    = 74;

            // Act
            var result = await controller.DeleteSkill(skillId);

            // Assert
            Assert.IsNotNull(result);
            var objResult = result.Result as NotFoundResult;

            Assert.IsNotNull(objResult);
        }
        public async void TestDeleteSkills()
        {
            var options = new DbContextOptionsBuilder <Databasecontext
                                                       >().UseInMemoryDatabase(databaseName: "Test4")
                          .Options;

            using (var context = new Databasecontext(options))
            {
                var skill = new Skill()
                {
                    SkillId          = 1,
                    skillName        = "test",
                    skillDescription = "test"
                };

                SkillsController Skills = new SkillsController(context);

                context.Skills.Add(skill);
                await Skills.DeleteSkill(1);

                var find = context.Skills.Find(1);
                Assert.Null(find);
            }
        }