コード例 #1
0
ファイル: ParameterTree.cs プロジェクト: lulzzz/BraneCloud
        public string ToString(string initialIndent)
        {
            var sb = new StringBuilder();

            sb = sb.AppendFormat("{0}{1} : {2}\n", initialIndent, "ParameterNamespace", FullName);
            sb = sb.AppendFormat("\t{0}{1}:\n", initialIndent, "LocalEntries");
            sb = LocalEntries.Aggregate(sb, (current, entry) => current.AppendFormat("\t\t{0}{1} = {2}\n", initialIndent, entry.Key, entry.Value));
            sb = Parents.Cast <FileDictionaryTree>().Aggregate(sb, (current, parent) => current.Append(parent.ToString(initialIndent + "\t")));
            return(sb.ToString());
        }
コード例 #2
0
        private ITestCase CreateInstance()
        {
            var pars = ReflectionHelper.GectConstructorParamTypes(testCaseType);

            if (pars.Any())
            {
                var relatedTestJobs = new List <object>();

                foreach (var par in pars)
                {
                    var relatedJob = Parents.Cast <TestCaseJob>().Single(x => x.TestCaseType.FullName == par.ParameterType.FullName);
                    relatedTestJobs.Add(relatedJob.GetInstance());
                }

                return(Activator.CreateInstance(testCaseType, relatedTestJobs.ToArray()) as ITestCase);
            }

            return(Activator.CreateInstance(testCaseType) as ITestCase);
        }