TestMethod.cs :  » Testing » xUnit.net » Xunit » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Testing » xUnit.net 
xUnit.net » Xunit » TestMethod.cs
using System.Collections.Generic;

namespace Xunit{
    /// <summary>
    /// Represents a single test method.
    /// </summary>
    public class TestMethod
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="TestMethod"/> class.
        /// </summary>
        /// <param name="methodName">The method name.</param>
        /// <param name="displayName">The method's display name.</param>
        /// <param name="traits">The method's traits.</param>
        public TestMethod(string methodName, string displayName, MultiValueDictionary<string, string> traits)
        {
            MethodName = methodName;
            DisplayName = displayName;
            Traits = traits;
            RunResults = new List<TestResult>();
        }

        /// <summary>
        /// Gets the method's display name.
        /// </summary>
        public string DisplayName { get; private set; }

        /// <summary>
        /// Gets the method's name.
        /// </summary>
        public string MethodName { get; private set; }

        /// <summary>
        /// Gets the run results for the last run.
        /// </summary>
        public List<TestResult> RunResults { get; internal set; }

        /// <summary>
        /// Gets the composite run status for all the results of the last run.
        /// </summary>
        public TestStatus RunStatus
        {
            get
            {
                TestStatus result = TestStatus.NotRun;

                foreach (TestResult testResult in RunResults)
                    if (testResult is TestPassedResult)
                    {
                        if (result == TestStatus.NotRun)
                            result = TestStatus.Passed;
                    }
                    else if (testResult is TestSkippedResult)
                    {
                        if (result != TestStatus.Failed)
                            result = TestStatus.Skipped;
                    }
                    else if (testResult is TestFailedResult)
                    {
                        result = TestStatus.Failed;
                    }

                return result;
            }
        }

        /// <summary>
        /// Gets the test class this test method belongs to.
        /// </summary>
        public TestClass TestClass { get; internal set; }

        /// <summary>
        /// Gets the method's traits.
        /// </summary>
        public MultiValueDictionary<string, string> Traits { get; private set; }
    }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.