AddTestCase() публичный статический Метод

public static AddTestCase ( IAddTestCaseCmdletBaseDataObject cmdlet ) : bool
cmdlet IAddTestCaseCmdletBaseDataObject
Результат bool
Пример #1
0
        internal override void Execute()
        {
            var cmdlet = (AddTestCaseCmdletBase)Cmdlet;

            // 20140721
            var dataObject = new AddTestCaseCmdletBaseDataObject {
                Id   = cmdlet.Id,
                Name = cmdlet.Name,
                // 20141211
                // TestCode = cmdlet.TestCode,
                TestCode = cmdlet.TestCode.Select(scriptblock => new CodeBlock {
                    Code = scriptblock.ToString()
                }).ToArray(),
                TestPlatformId = cmdlet.TestPlatformId
            };

            // bool result = TmxHelper.AddTestCase(cmdlet);
            bool result = TmxHelper.AddTestCase(dataObject);

            if (result)
            {
                cmdlet.WriteObject(
                    cmdlet,
                    TestData.CurrentTestCase);
            }
            else
            {
                cmdlet.WriteError(
                    cmdlet,
                    "Couldn't add a test case",
                    "AddingTestCase",
                    ErrorCategory.InvalidArgument,
                    true);
            }
        }