-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dependency ordering between stateful resources. Closes GH-81
- Loading branch information
1 parent
178f49f
commit c712b98
Showing
5 changed files
with
117 additions
and
1 deletion.
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
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,30 @@ | ||
using System.Linq; | ||
using Shouldly; | ||
using Xunit; | ||
|
||
namespace Tests.Resources; | ||
|
||
public class resource_ordering : ResourceCommandContext | ||
{ | ||
[Fact] | ||
public void respect_ordering_by_dependencies() | ||
{ | ||
var one = AddResourceWithDependencies("one", "system", "blue", "red"); | ||
var two = AddResourceWithDependencies("two", "system", "blue", "red", "one"); | ||
|
||
var blue = AddResource("blue", "color"); | ||
var red = AddResource("red", "color"); | ||
|
||
var tx = AddResource("tx", "state"); | ||
var ar = AddResource("ar", "state"); | ||
|
||
var resources = applyTheResourceFiltering(); | ||
|
||
resources.Count.ShouldBe(6); | ||
|
||
resources.Last().ShouldBe(two); | ||
|
||
resources.Select(x => x.Name).ShouldBe(new string[] { "blue", "red", "ar", "tx", "one", "two" }); | ||
|
||
} | ||
} |