forked from davidmfoley/storevil
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
made MultipleWords and ContextRegex attributes use reflection to tole…
…rate different versions of StorEvil
- Loading branch information
1 parent
00d3737
commit c573e6d
Showing
3 changed files
with
74 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
using NUnit.Framework; | ||
using StorEvil.Assertions; | ||
|
||
namespace StorEvil.Utility | ||
{ | ||
public class PathTree_Specs | ||
{ | ||
protected PathTree PathTree; | ||
|
||
|
||
[TestFixture] | ||
public class Empty_tree : PathTree_Specs | ||
{ | ||
[SetUp] | ||
public void SetUpContext() | ||
{ | ||
PathTree = new PathTree(); | ||
} | ||
|
||
[Test] | ||
public void count_is_zero() | ||
{ | ||
PathTree.Count.ShouldEqual(0); | ||
|
||
} | ||
|
||
[Test] | ||
public void Root_is_an_empty_node() | ||
{ | ||
var count = this.PathTree.Root.Children.Count; | ||
count.ShouldEqual(0); | ||
} | ||
} | ||
|
||
[TestFixture] | ||
public class Adding_nodes : PathTree_Specs | ||
{ | ||
[SetUp] | ||
public void SetUpContext() | ||
{ | ||
PathTree = new PathTree(); | ||
PathTree.Put(new[] { "foo", "bar" }, "foo/bar"); | ||
} | ||
|
||
[Test] | ||
public void Can_retrieve_node() | ||
{ | ||
var o = PathTree.Get(new[] { "foo", "bar" }); | ||
o.ShouldEqual("foo/bar"); | ||
} | ||
|
||
[Test] | ||
public void returns_null_for_unknown_sub_path() | ||
{ | ||
PathTree.Get(new[] { "foo", "bar", "baz" }).ShouldBe(null); | ||
} | ||
|
||
[Test] | ||
public void returns_null_for_completely_unknown_path() | ||
{ | ||
PathTree.Get(new[] { "bar", "baz" }).ShouldBe(null); | ||
} | ||
} | ||
} | ||
} |