Пример #1
0
        public async Task BusinessTestFor_EditSkill_Possitive()
        {
            try
            {
                _skill.SkillLevel           = SkillLevel.Expert;
                _skill.SkillTotalExperiance = 10;
                var result = await _skillService.EditSkill(_skill);

                if (result == 1)
                {
                    testResult = "BusinessTestFor_EditSkill_Possitive=" + "True";
                    fileUtility.WriteTestCaseResuItInText(testResult);
                    // Write test case result in xml file
                    if (config["env"] == "development")
                    {
                        cases newcase = new cases
                        {
                            TestCaseType   = "Business",
                            Name           = "BusinessTestFor_EditSkill_Possitive",
                            expectedOutput = "True",
                            weight         = 5,
                            mandatory      = "True",
                            desc           = "na"
                        };
                        await fileUtility.WriteTestCaseResuItInXML(newcase);
                    }
                }
                else
                {
                    Assert.Equal(1, result);
                }
            }
            catch (Exception exception)
            {
                var res = exception.Message;
                testResult = "BusinessTestFor_EditSkill_Possitive=" + "False";
                fileUtility.WriteTestCaseResuItInText(testResult);
                // Write test case result in xml file
                if (config["env"] == "development")
                {
                    cases newcase = new cases
                    {
                        TestCaseType   = "Business",
                        Name           = "BusinessTestFor_EditSkill_Possitive",
                        expectedOutput = "False",
                        weight         = 5,
                        mandatory      = "False",
                        desc           = "na"
                    };
                    await fileUtility.WriteTestCaseResuItInXML(newcase);
                }
            }
        }
Пример #2
0
        public async Task <ActionResult <int> > ReviseSkill(Skill skill)
        {
            try
            {
                //Business logic to call skill servic method which returns 1 on successfull updation of skill
                var result = await _skillService.EditSkill(skill);

                return(result);
            }
            catch (Exception exception)
            {
                return(BadRequest(exception.ToString()));
            }
        }