当前位置: 首页>>代码示例>>C#>>正文


C# TestType.ToString方法代码示例

本文整理汇总了C#中TestType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# TestType.ToString方法的具体用法?C# TestType.ToString怎么用?C# TestType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestType的用法示例。


在下文中一共展示了TestType.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Big_long_expressions_work

        public void Big_long_expressions_work(TestState testState, TestType testType, string expected)
        {

            var actual = _queryStringBuilder
                .QueryStringWith(testState == TestState.All ? "" : "state=" + testState.ToString().EnumNameToTransportCase())
                .AndWith(testType == TestType.All ? "" : "type=" + testType.ToString().EnumNameToTransportCase())
                .Build();
            actual.Should().Be(expected);
        }
开发者ID:RobertDyball,项目名称:recurly-client-net,代码行数:9,代码来源:QueryBuilderTest.cs

示例2: CreateTestResult

        public TestResult CreateTestResult(TestType type, string fullName,
                                           ResultState state = ResultState.Success, 
                                           Func<IEnumerable<TestResult>> children = null, 
                                           string stackTrace = null, 
                                           string description = null,
                                           IList categories = null,
                                           string agentName = null)
        {
            description = description ?? RandomValuesGenerator.GetRandomValue<string>();
            agentName = agentName ?? RandomValuesGenerator.GetRandomValue<string>();
            var splitted = (fullName ?? string.Empty).Split(new[]{'.'}, StringSplitOptions.RemoveEmptyEntries);

            var childResults = children != null ? children() : new TestResult[0];
            var testResult = new TestResult(new TestInfoWrapper
                                                {
                                                    TestName = new TestName
                                                                   {
                                                                       FullName = fullName,
                                                                       Name = splitted.Length > 0 ? splitted[splitted.Length - 1] : string.Empty
                                                                   },
                                                    Categories = categories,
                                                    IsSuite = type != TestType.TestMethod,
                                                    TestCount = type == TestType.TestMethod ? 1 : RandomValuesGenerator.GetRandomValue<int>(),
                                                    TestType = type.ToString()
                                                })
                                 {
                                     AssertCount = 1,
                                     Time = RandomValuesGenerator.GetRandomValue<double>()
                                 };
            if (state != ResultState.Success)
                testResult.SetResult(state,
                                     description,
                                     stackTrace);
            else
                testResult.Success(description);

            testResult.SetAgentName(agentName);

            foreach (var childResult in childResults)
            {
                testResult.AddResult(childResult);
            }

            return testResult;
        }
开发者ID:ayezutov,项目名称:NDistribUnit,代码行数:45,代码来源:TestEntitiesGenerator.cs

示例3: BuildTest

        private void BuildTest(string file, TestType type)
        {
            // Build the csproj.
            bool isBuildDone = false;
            int attempts = 0;
            string output = string.Empty;
            string msbuildexe = FindLatestMsbuildVersion() + "MSBuild.exe";

            // Attempting building upto three times.
            while (!isBuildDone && attempts++ < 3)
            {
                Console.Write("\tBuilding the " + type.ToString().ToLower() + " test..");
                ProcessStartInfo psi = new ProcessStartInfo(msbuildexe, "\"" + file + "\"");
                psi.UseShellExecute = false;
                psi.RedirectStandardOutput = true;
                Process proc = System.Diagnostics.Process.Start(psi);
                output = proc.StandardOutput.ReadToEnd();
                isBuildDone = proc.WaitForExit(60000);                

                if (isBuildDone && proc.ExitCode == 0)
                {
                    Console.WriteLine(" built successfully");
                    return;
                }
                else
                {
                    isBuildDone = false;
                    Console.WriteLine(" build failure.. retrying..");
                }
            }

            if (!isBuildDone)
            {
                Console.WriteLine(" BUILD FAILURE.. quitting..");
                throw new ApplicationException("\r\nBUILD FAILURE: \r\n" + output + "\r\n File: \r\n" + file);
            }
        }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:37,代码来源:Harness.cs


注:本文中的TestType.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。