示例#1
0
        public Task <bool> AddAsync(IEnumerable <TestCaseInfo> items)
        {
            Task <bool> newTask = new Task <bool>(() =>
            {
                string assemblyFolder             = this.configurationManager.GetConfigValue(Constants.TestAssembliesFolder);
                IEnumerable <string> testAssembly = (from r in items select r.Source).Distinct(StringComparer.InvariantCultureIgnoreCase);
                testAssembly = this.CopyFile(testAssembly);
                foreach (TestCaseInfo testCase in items)
                {
                    string orignalSource = Path.GetFileName(testCase.Source);
                    testCase.Source      = Path.Combine(assemblyFolder, orignalSource, orignalSource);
                    if (!this.methodInfos.Contains(testCase))
                    {
                        this.methodInfos.Add(testCase);
                    }
                }

                string output = TestCaseInfo.SerializeList(this.methodInfos);
                File.WriteAllText(defaultReposFile, output, this.configurationManager.GetEncoding());

                return(true);
            });

            newTask.Start();
            return(newTask);
        }
示例#2
0
        public Task <bool> DeleteAsync(Guid id)
        {
            int    count  = this.methodInfos.RemoveAll(o => o.Id.Equals(id));
            string output = TestCaseInfo.SerializeList(this.methodInfos);

            File.WriteAllText(defaultReposFile, output, this.configurationManager.GetEncoding());
            return(Task.FromResult(count == 1));
        }
示例#3
0
        public Task <bool> DeleteRange(IEnumerable <TestCaseInfo> items)
        {
            int    count  = this.methodInfos.RemoveAll(o => items.Contains(o));
            string output = TestCaseInfo.SerializeList(this.methodInfos);

            File.WriteAllText(defaultReposFile, output, this.configurationManager.GetEncoding());
            return(Task.FromResult(count == 1));
        }