Exemplo n.º 1
0
        private static IWorkItemBase CreateNewTestCaseData(ComparisionResult result)
        {
            var scenarioData = DbOperations.getEAscenario(result.Guid);

            var data = new[] {
                new WorkItemBaseDataTestCase
                {
                    Op    = "add",
                    Path  = "/fields/System.Title",
                    Value = scenarioData.Name
                },
                new WorkItemBaseDataTestCase()
                {
                    Op    = "add",
                    Path  = "/fields/Microsoft.VSTS.TCM.Steps",
                    Value = GenerateNewTestCaseJson(result)
                }
            };

            var creationData = new WorkItemCreationData
            {
                Guid         = result.Guid,
                WorkItemType = WorkItemType.TestCase,
                Content      = new StringContent(JsonConvert.SerializeObject(data), Encoding.UTF8, "application/json-patch+json")
            };

            return(creationData);
        }
Exemplo n.º 2
0
        private static IWorkItemBase GetExistingTestCaseData(ComparisionResult result)
        {
            var existingData = GetExistingData(result);
            var creationData = new WorkItemCreationData
            {
                Guid             = result.Guid,
                WorkItemId       = existingData.WorkItemId,
                WorkItemBaseData = new WorkItemBaseDataTestCase
                {
                    Value = existingData.Value
                }
            };

            return(creationData);
        }