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


C# ITest.GetType方法代码示例

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


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

示例1: RunTest

        protected static void RunTest(ITest test)
        {
            int loops = Calibrate(test, TimeSpan.FromMilliseconds(1000));

            var sw = new Stopwatch();

            GC.Collect();
            GC.WaitForPendingFinalizers();

            var c1 = GC.CollectionCount(0);
            var c2 = GC.CollectionCount(1);
            var c3 = GC.CollectionCount(2);

            sw.Start();
            test.DoTest(loops);
            sw.Stop();

            c1 = GC.CollectionCount(0) - c1;
            c2 = GC.CollectionCount(1) - c2;
            c3 = GC.CollectionCount(2) - c3;

            var lps = (int)(loops / (sw.ElapsedMilliseconds / 1000.0));

            Console.WriteLine("{0,-40} {1,20} loops/s, collections {2}/{3}/{4}",
                test.GetType().Name, lps,
                c1, c2, c3);
        }
开发者ID:tomba,项目名称:dwarrowdelf,代码行数:27,代码来源:Program.cs

示例2: Run

        public void Run(ITest test)
        {
            Console.WriteLine("******************* Start {0} *******************", test.GetType().Name);

            PrintMemorySize("first");

            test.Initialize();

            for (int i = 0; i < TestCount; i++)
            {
                test.Do(i);

                if (i % PrintCount == 0)
                {
                    PrintMemorySize("do(" + i + ")");
                }
            }

            test.Cleanup();

            PrintMemorySize("last");

            Console.WriteLine("******************* Finish {0} *******************", test.GetType().Name);
        }
开发者ID:garaemon,项目名称:RosSharp,代码行数:24,代码来源:TestRunner.cs

示例3: Add

 public TestMonitor Add(ITest test)
 {
     var key = test.GetType().FullName;
     var keyFormat = key + ".{0}";
     var i = 1;
     while (!tests.TryAdd(key, test))
     {
         key = string.Format(keyFormat, i);
         i++;
     }
     var monitor = monitors.GetOrAdd(key, (k) =>
     {
         var m = new TestMonitor(this, k, test) { HttpContext = this.HttpContext };
         m.Started += OnTestStarted;
         m.Completed += OnTestCompleted;
         m.EventReceived += OnTestEventReceived;
         m.ProgressChanged += OnProgressChanged;
         return m;
     });
     return monitor;
 }
开发者ID:ChrisBriggsy,项目名称:SSW.HealthCheck,代码行数:21,代码来源:HealthCheckService.cs

示例4: GetTestSummary

 // NOTE: When test.ToString() displays something less stupid than 
 // MethodName(Namespace.ClassName) think about changing to that.  As it 
 // is now its impossible to sort the test output.
 // The workaround is to use this method.
 private static string GetTestSummary(ITest test) {
     string nunitInfo = test.ToString();
     return test.GetType().Name + "." + nunitInfo.Substring(0, nunitInfo.IndexOf('('));
 }
开发者ID:RoastBoy,项目名称:nant,代码行数:8,代码来源:LogFormatter.cs

示例5: StartTest

        public void StartTest(ITest test) {
            _testStartTime =  DateTime.Now;
            _currentTest = _document.CreateElement(ElementTestCase);
            _currentTest.SetAttribute(AttributeName, ((TestCase ) test).ToString());
            
            string className = test.GetType().FullName;
            _currentTest.SetAttribute(AttributeClassname, className);

            _suiteElement.AppendChild(_currentTest);
        }
开发者ID:RoastBoy,项目名称:nant,代码行数:10,代码来源:XmlResultFormatter.cs


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