NUnit.Framework.TestCaseData.SetCategory C# (CSharp) Méthode

SetCategory() public méthode

Applies a category to the test
public SetCategory ( string category ) : TestCaseData
category string
Résultat TestCaseData
        public TestCaseData SetCategory(string category)
        {
            this.Categories.Add(category);
            return this;
        }

Usage Example

Exemple #1
0
 public static IEnumerable<ITestCaseData> GetTestCases()
 {
     const string prefix = "MongoDB.Driver.Specifications.server_selection.tests.rtt.";
     return Assembly
         .GetExecutingAssembly()
         .GetManifestResourceNames()
         .Where(path => path.StartsWith(prefix) && path.EndsWith(".json"))
         .Select(path =>
         {
             var definition = ReadDefinition(path);
             var fullName = path.Remove(0, prefix.Length);
             var data = new TestCaseData(definition);
             data.SetCategory("Specifications");
             data.SetCategory("server-selection");
             return data.SetName(fullName.Remove(fullName.Length - 5));
         });
 }
All Usage Examples Of NUnit.Framework.TestCaseData::SetCategory