Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions exercises/practice/satellite/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,12 @@ description = "Reject inconsistent traversals of same length"

[d86a3d72-76a9-43b5-9d3a-e64cb1216035]
description = "Reject traversals with repeated items"

[af31ae02-7e5b-4452-a990-bccb3fca9148]
description = "A degenerate binary tree"

[ee54463d-a719-4aae-ade4-190d30ce7320]
description = "Another degenerate binary tree"

[87123c08-c155-4486-90a4-e2f75b0f3e8f]
description = "Tree with many more items"
21 changes: 21 additions & 0 deletions exercises/practice/satellite/SatelliteTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,25 @@ public void Reject_traversals_with_repeated_items()
{
Assert.Throws<ArgumentException>(() => Satellite.TreeFromTraversals(['a', 'b', 'a'], ['b', 'a', 'a']));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void A_degenerate_binary_tree()
{
var expected = new Tree('a', new Tree('b', new Tree('c', new Tree('d', null, null), null), null), null);
Assert.Equal(expected, Satellite.TreeFromTraversals(['a', 'b', 'c', 'd'], ['d', 'c', 'b', 'a']));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void Another_degenerate_binary_tree()
{
var expected = new Tree('a', null, new Tree('b', null, new Tree('c', null, new Tree('d', null, null))));
Assert.Equal(expected, Satellite.TreeFromTraversals(['a', 'b', 'c', 'd'], ['a', 'b', 'c', 'd']));
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void Tree_with_many_more_items()
{
var expected = new Tree('a', new Tree('b', new Tree('d', new Tree('g', null, null), new Tree('h', null, null)), null), new Tree('c', new Tree('e', null, null), new Tree('f', new Tree('i', null, null), null)));
Assert.Equal(expected, Satellite.TreeFromTraversals(['a', 'b', 'd', 'g', 'h', 'c', 'e', 'f', 'i'], ['g', 'd', 'h', 'b', 'a', 'e', 'c', 'i', 'f']));
}
}
Loading