Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Category inheritance feature spec added.
- Loading branch information
Showing
4 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using Cone.Core; | ||
using Cone.Runners; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Cone.Features | ||
{ | ||
[Feature("Category Handling")] | ||
public class CategoryHandlingFeature | ||
{ | ||
[Feature("Sugar Sweet")] | ||
class ExampleSpec { | ||
[Context("I'm Sugar", Category = "Sugar")] | ||
public class ExampleSugarSpec | ||
{ | ||
public void sugar() { } | ||
|
||
[Context("I'm Sweet", Category = "Sweet")] | ||
public class ExampleSugarSweetSpec | ||
{ | ||
public void sugar_sweet() { } | ||
} | ||
} | ||
} | ||
|
||
public void categories_are_lexically_inherited() { | ||
var suite = new ConePadSuiteBuilder(new DefaultObjectProvider()) | ||
.BuildSuite(typeof(ExampleSpec)); | ||
|
||
var result = new List<string>(); | ||
suite.RunAll((tests, fixture) => { | ||
result.AddRange(tests.Select(test => test.TestName.Name + " - " + string.Join(",", test.Categories))); | ||
}); | ||
|
||
Check.That( | ||
() => result.Contains("sugar - Sugar"), | ||
() => result.Contains("sugar sweet - Sugar,Sweet") | ||
); | ||
} | ||
|
||
} | ||
} |