• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ITestCase类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ITestCase的典型用法代码示例。如果您正苦于以下问题:C# ITestCase类的具体用法?C# ITestCase怎么用?C# ITestCase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ITestCase类属于命名空间,在下文中一共展示了ITestCase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Filter

 public bool Filter(IFixture fixture, ITestCase test)
 {
     foreach (string scope in scopes)
         if (test.Name.ToLower().StartsWith(scope.ToLower()))
             return true;
     return false;
 }
开发者ID:sayedjalilhassan,项目名称:LearningPlatform,代码行数:7,代码来源:ScopeTestCaseFilter.cs


示例2: TestFailed

 public TestFailed(ITestCase testCase, string testDisplayName, decimal executionTime, string output, string exceptionType, string message, string stackTrace)
     : base(testCase, testDisplayName, executionTime, output)
 {
     StackTrace = stackTrace;
     Message = message;
     ExceptionType = exceptionType;
 }
开发者ID:JayBazuzi,项目名称:xunit,代码行数:7,代码来源:TestFailed.cs


示例3: Convert

        private static VsTestCase Convert(
            ITestCase testcase,
            string shortName,
            string fullyQualifiedName,
            bool uniquifyNames)
        {
            string uniqueName;
            if (uniquifyNames)
                uniqueName = string.Format("{0}({1})", fullyQualifiedName, testcase.UniqueID);
            else
                uniqueName = fullyQualifiedName;

            var result = new VsTestCase();
            result.DisplayName = shortName;
            result.FullyQualifiedName = uniqueName;

            result.Id = GuidFromString(testcase.UniqueID);

            if (testcase.SourceInformation != null)
            {
                result.CodeFilePath = testcase.SourceInformation.FileName;
                result.LineNumber = testcase.SourceInformation.LineNumber;
            }

            return result;
        }
开发者ID:andschwa,项目名称:coreclr.xunit,代码行数:26,代码来源:DesignTimeTestConverter.cs


示例4: SetUpTearDownDecoratorTestCase

 public SetUpTearDownDecoratorTestCase(ITestCase testCase,
     MethodInfo setUpMethod, MethodInfo tearDownMethod)
     : base(testCase)
 {
     this.setUpMethod = setUpMethod;
     this.tearDownMethod = tearDownMethod;
 }
开发者ID:BackupTheBerlios,项目名称:mbunit-svn,代码行数:7,代码来源:SetUpTearDownTestCaseDecorator.cs


示例5: ExpectedExceptionTestCase

 public ExpectedExceptionTestCase(ITestCase testCase,Type exceptionType)
     : base(testCase)
 {
     if (exceptionType == null)
         throw new ArgumentNullException("exceptionType");
     this.exceptionType = exceptionType;
 }
开发者ID:BackupTheBerlios,项目名称:mbunit-svn,代码行数:7,代码来源:ExpectedExceptionTestCase.cs


示例6: GetSourceInformation

        /// <inheritdoc/>
        public SourceInformation GetSourceInformation(ITestCase testCase)
        {
            return new SourceInformation();

            // TODO: Load DiaSession dynamically, since it's only available when running inside of Visual Studio.
            //       Or look at the CCI2 stuff from the Rx framework: https://github.com/Reactive-Extensions/IL2JS/tree/master/CCI2/PdbReader
        }
开发者ID:JoB70,项目名称:xunit,代码行数:8,代码来源:VisualStudioSourceInformationProvider.cs


示例7: DoTest

        public override TestResult DoTest(ITestCase testCase, int testCasesNumber, bool singleton)
        {
            var result = new TestResult { Singleton = singleton, TestCasesNumber = testCasesNumber };
            var sw = new Stopwatch();

            var c = new ServiceContainer();
            if (singleton)
            {
                sw.Start();
                c = (ServiceContainer)testCase.SingletonRegister(c);
                sw.Stop();
            }
            else
            {
                sw.Start();
                c = (ServiceContainer)testCase.TransientRegister(c);
                sw.Stop();
            }
            result.RegisterTime = sw.ElapsedMilliseconds;

            sw.Reset();
            result.ResolveTime = DoResolve(sw, testCase, c, testCasesNumber, singleton);

            c.Dispose();

            return result;
        }
开发者ID:amularczyk,项目名称:NiquIoC,代码行数:27,代码来源:LightInjectPerformance.cs


示例8: SoSanh

        public bool SoSanh(string output, ITestCase testcase, out string message)
        {
            message = "";
            string[] s1Lines = output.Split('\n');
            string[] s2Lines = testcase.Output.Split('\n');
            int i = 0;
            while (i < s1Lines.Length && i < s2Lines.Length)
            {
                if (SoSanhLine(s1Lines[i], s2Lines[i]) == false)
                {
                    message = "SAI KẾT QUẢ 1";
                    return false;
                }
                i++;
            }
            while (i < s1Lines.Length)
            {
                if (!IsEmptyLine(s1Lines[i]))
                {
                    message = "SAI KẾT QUẢ 2";
                    return false;
                }

            }
            while (i < s2Lines.Length)
            {
                if (!IsEmptyLine(s2Lines[i]))
                {
                    message = "SAI KẾT QUẢ 3";
                    return false;
                }
            }
            message = "ĐÚNG KẾT QUẢ";
            return true;
        }
开发者ID:ngocpq,项目名称:OnlineSPKT,代码行数:35,代码来源:SoSanhSoNguyen.cs


示例9: RemoveAutomation

 /// <summary>
 /// Removes automation from a test case.
 /// </summary>
 public void RemoveAutomation(ITestCase testCase)
 {
     testCase.WorkItem.Open();
     testCase.Implementation = null;
     testCase.CustomFields["Automation status"].Value = "Not Automated";
     testCase.Save();
 }
开发者ID:testpulse,项目名称:TFSTestCaseAutomator,代码行数:10,代码来源:TestCaseAutomationService.cs


示例10: TestCaseWorker

 public TestCaseWorker(ITestCase testCase, int index)
 {
     if (testCase == null)
         throw new ArgumentNullException("testCase");
     this.testCase = testCase;
     this.index = index;
 }
开发者ID:sayedjalilhassan,项目名称:LearningPlatform,代码行数:7,代码来源:TestCaseWorker.cs


示例11: GetShortName

        private static string GetShortName(ITestCase tc)
        {
            var shortName = new StringBuilder();

            var classFullName = tc.TestMethod.TestClass.Class.Name;
            var dotIndex = classFullName.LastIndexOf('.');
            if (dotIndex >= 0)
                shortName.Append(classFullName.Substring(dotIndex + 1));
            else
                shortName.Append(classFullName);

            shortName.Append(".");
            shortName.Append(tc.TestMethod.Method.Name);

            // We need to shorten the arguments list if it's long. Let's arbitrarily pick 50 characters.
            var argumentsIndex = tc.DisplayName.IndexOf('(');
            if (argumentsIndex >= 0 && tc.DisplayName.Length - argumentsIndex > 50)
            {
                shortName.Append(tc.DisplayName.Substring(argumentsIndex, 46));
                shortName.Append("...");
                shortName.Append(")");
            }
            else if (argumentsIndex >= 0)
                shortName.Append(tc.DisplayName.Substring(argumentsIndex));

            return shortName.ToString();
        }
开发者ID:andschwa,项目名称:coreclr.xunit,代码行数:27,代码来源:DesignTimeTestConverter.cs


示例12: Add

 #region Add/Remove Test cases
 /// <summary>
 /// Adds the test case to the suite
 /// </summary>
 /// <param name="testCase"><see cref="TestCase"/> instance to add.</param>
 /// <exception cref="InvalidOperationException">
 /// The suite already contains a test case with the same name as <paramref name="testCase"/>.
 /// </exception>
 public void Add(ITestCase testCase)
 {
     if (testCase == null)
         throw new ArgumentNullException("testCase");
     if (this.testCases.Contains(testCase.Name))
         throw new InvalidOperationException("TestCase " + testCase.Name + " already in collection");
     this.testCases.Add(testCase);
开发者ID:timonela,项目名称:mb-unit,代码行数:15,代码来源:TestSuite.cs


示例13: TestCleanupFailure

 /// <summary>
 /// Initializes a new instance of the <see cref="TestCleanupFailure"/> class.
 /// </summary>
 public TestCleanupFailure(ITestCase testCase, string displayName, string[] exceptionTypes, string[] messages, string[] stackTraces, int[] exceptionParentIndices)
     : base(testCase, displayName)
 {
     StackTraces = stackTraces;
     Messages = messages;
     ExceptionTypes = exceptionTypes;
     ExceptionParentIndices = exceptionParentIndices;
 }
开发者ID:ansarisamer,项目名称:xunit,代码行数:11,代码来源:TestCleanupFailure.cs


示例14: Filter

 public bool Filter(IFixture fixture, ITestCase testCase)
 {
     XmlTestCase xtestCase = this.Searcher.GetTestCase(fixture.Name, testCase.Name);
     if (xtestCase == null)
         return false;
     else
         return xtestCase.State == TestState.Failure;
 }
开发者ID:sayedjalilhassan,项目名称:LearningPlatform,代码行数:8,代码来源:FailureFilter.cs


示例15: FilterIncludedNames

        bool FilterIncludedNames(ITestCase testCase)
        {
            // No names in the filter == everything is okay
            if (IncludedNames.Count == 0)
                return true;

            return IncludedNames.Contains(testCase.DisplayName);
        }
开发者ID:ansarisamer,项目名称:xunit,代码行数:8,代码来源:XunitFilters.cs


示例16: TestCaseFinished

 public TestCaseFinished(ITestCase testCase, decimal executionTime, int testsRun, int testsFailed, int testsSkipped)
     : base(testCase)
 {
     ExecutionTime = executionTime;
     TestsRun = testsRun;
     TestsFailed = testsFailed;
     TestsSkipped = testsSkipped;
 }
开发者ID:PKRoma,项目名称:xunit-codeplex,代码行数:8,代码来源:TestCaseFinished.cs


示例17: ExpectedException

 public static ExpectedExceptionTestCase ExpectedException(ITestCase testCase, Type exceptionType)
 {
     if (testCase == null)
         throw new ArgumentNullException("testCase");
     if (exceptionType == null)
         throw new ArgumentNullException("exceptionType");
     return new ExpectedExceptionTestCase(testCase, exceptionType);
 }
开发者ID:BackupTheBerlios,项目名称:mbunit-svn,代码行数:8,代码来源:TestCases.cs


示例18: DecorateTest

 public static ITestCase DecorateTest(ITestCase testCase, MethodInfo method)
 {
     ITestCase test = testCase;
     foreach (TestDecoratorAttributeBase attribute in method.GetCustomAttributes(typeof(TestDecoratorAttributeBase), true))
     {
         test = attribute.Decorate(test);
     }
     return test;
 }
开发者ID:buptkang,项目名称:QuickGraph,代码行数:9,代码来源:TestDecoratorAttributeBase.cs


示例19: Filter

        /// <summary>
        /// Filters the given method using the defined filter values.
        /// </summary>
        /// <param name="testCase">The test case to filter.</param>
        /// <returns>Returns <c>true</c> if the test case passed the filter; returns <c>false</c> otherwise.</returns>
        public bool Filter(ITestCase testCase)
        {
            if (!FilterIncludedTraits(testCase))
                return false;
            if (!FilterExcludedTraits(testCase))
                return false;

            return true;
        }
开发者ID:PKRoma,项目名称:xunit-codeplex,代码行数:14,代码来源:XunitFilters.cs


示例20: Compare

        int Compare(ITestCase x, ITestCase y)
        {
            var xHash = x.UniqueID.GetHashCode();
            var yHash = y.UniqueID.GetHashCode();

            if (xHash == yHash)
                return 0;
            if (xHash < yHash)
                return -1;
            return 1;
        }
开发者ID:PKRoma,项目名称:xunit-codeplex,代码行数:11,代码来源:DefaultTestCaseOrderer.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ITestClass类代码示例发布时间:2022-05-24
下一篇:
C# ITest类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap