コード例 #1
0
        /// <summary>
        /// Processes each record.
        /// </summary>
        protected override void ProcessRecord()
        {
            if (!String.IsNullOrEmpty(CaseScope))
            {
                IAction scopeAction = new ScopeCaseAction(CaseScope);
                scopeAction.Execute(TestSuite);
                WriteVerbose(scopeAction.Display);
            }

            string templateActionName = ParameterSetName.Split(new[] { '-' }, 2)[0];
            string actionName         = ParameterSetName.Split(new[] { '-' }, 2)[1];

            if (actionName == "Static")
            {
                IAction testCaseAction = ProcessStaticAction(templateActionName);
                testCaseAction.Execute(TestSuite);
                WriteVerbose(testCaseAction.Display);
            }
            else
            {
                ProcessTemplate(templateActionName).Execute(TestSuite);
                ProcessCases(actionName).Execute(TestSuite);

                if (String.IsNullOrEmpty(GroupPath))
                {
                    IAction suiteAction = new GenerateTestSuiteAction(false);
                    suiteAction.Execute(TestSuite);
                    WriteVerbose(suiteAction.Display);
                }
                else
                {
                    IAction suiteAction = new GenerateTestGroupBySuiteAction(GroupPath);
                    suiteAction.Execute(TestSuite);
                    WriteVerbose(suiteAction.Display);
                }
            }
            WriteObject(TestSuite);
        }
コード例 #2
0
        private JObject SetParameters(JObject template, JObject parameters)
        {
            SetParameter(ref parameters, "clusterName", this.ClusterName);
            SetParameter(ref parameters, "applicationName", this.ApplicationName);
            SetParameter(ref parameters, "serviceName", this.Name);

            SetServiceParameter(template, parameters, "serviceTypeName", this.Type);
            SetServiceParameter(template, parameters, "partitionDescription", JObject.Parse($"{{\"partitionScheme\":\"{ParameterSetName.Split('-')[1]}\"}}"));

            if (this.Stateless.IsPresent)
            {
                SetServiceParameter(template, parameters, "instanceCount", this.InstanceCount);
            }
            else
            {
                SetServiceParameter(template, parameters, "targetReplicaSetSize", this.TargetReplicaSetSize);
                SetServiceParameter(template, parameters, "minReplicaSetSize", this.MinReplicaSetSize);
            }

            if (this.IsParameterBound(c => c.DefaultMoveCost))
            {
                SetServiceParameter(template, parameters, "defaultMoveCost", this.DefaultMoveCost.ToString());
            }

            return(parameters);
        }