-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose the ability to attach categories to test methods even to the c…
…one world.
- Loading branch information
Tobbe Gyllebring
committed
Aug 2, 2018
1 parent
69bfeca
commit e4ada0d
Showing
6 changed files
with
42 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Cone | ||
{ | ||
public interface IHaveCategories | ||
{ | ||
IEnumerable<string> Categories { get; } | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using Cone.Core; | ||
using Cone.Core; | ||
|
||
namespace Cone | ||
{ | ||
|
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,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Cone.Runners; | ||
|
||
namespace Cone.Specs.Runners | ||
{ | ||
[Describe(typeof(ConeTestMethodContext))] | ||
public class ConeTestMethodContextSpec | ||
{ | ||
class MyCategories : IHaveCategories | ||
{ | ||
public string[] Categories; | ||
IEnumerable<string> IHaveCategories.Categories => Categories; | ||
} | ||
|
||
public void extracts_categories_from_attributes() { | ||
Check.With(() => ConeTestMethodContext.Attributes(new[] { new MyCategories { Categories = new[] { "MyCat" } } })) | ||
.That(context => context.Categories.Contains("MyCat")); | ||
} | ||
} | ||
} |