我已经分配了创建C#应用程序来更新MTM中的测试用例状态.
我尝试了下面的代码,它工作正常.但问题是以下代码正在更新结果如果测试用例已经执行,则不会更新新创建的测试用例的状态(没有运行历史记录)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.WorkItemTracking.Client;
using Microsoft.TeamFoundation.TestManagement.Client;
using Microsoft.TeamFoundation.TestManagement.Common;
using System.IO;
namespace UpdateTFS
{
class Program
{
static void Main(string[] args)
{
//args[0] = TestplanId; args[1] = TestcaseId; args[2] = Status; args[3] = configuration
int test_plan = Int32.Parse(args[0]);
int test_case = Int32.Parse(args[1]);
int test_config = Int32.Parse(args[3]);
int result_updated = 0;
TextWriter tw = new StreamWriter(@"C:\Users\*\Desktop\MTM.txt", true);
tw.WriteLine("Attempting the test case " +test_case+ "to be marked as "+args[3]);
//Create TFS …Run Code Online (Sandbox Code Playgroud)