public void Two_nodes() { const string input = "(;A[B];B[C])"; var expected = TreeWithSingleChild(CreateData("A", "B"), TreeWithNoChildren(CreateData("B", "C"))); Assert.Equal(expected, SgfParser.ParseTree(input), SgfTreeEqualityComparer.Instance); }
public void Node_without_properties() { const string input = "(;)"; var expected = TreeWithNoChildren(new Dictionary <string, string[]>()); Assert.Equal(expected, SgfParser.ParseTree(input), SgfTreeEqualityComparer.Instance); }
public void Multiple_properties() { const string input = "(;A[b][c][d])"; var expected = TreeWithNoChildren(CreateData("A", "b", "c", "d")); Assert.Equal(expected, SgfParser.ParseTree(input), SgfTreeEqualityComparer.Instance); }
public void Escaped_property() { const string input = @"(;A[\]b\nc\nd\t\te \n\]])"; var expected = TreeWithNoChildren(CreateData("A", "]b\nc\nd e \n]")); Assert.Equal(expected, SgfParser.ParseTree(input), SgfTreeEqualityComparer.Instance); }
public void Node_without_properties() { var encoded = "(;)"; var expected = new SgfTree(new Dictionary <string, string[]>()); AssertEqual(expected, SgfParser.ParseTree(encoded)); }
public void Single_node_tree() { const string input = "(;A[B])"; var expected = TreeWithNoChildren(CreateData("A", "B")); Assert.Equal(expected, SgfParser.ParseTree(input), SgfTreeEqualityComparer.Instance); }
public void Escaped_property() { const string input = @"(;A[\]b\nc\nd\t\te \n\]])"; var expected = TreeWithNoChildren(CreateData("A", @"]b c d e ]")); Assert.That(SgfParser.ParseTree(input), Is.EqualTo(expected).Using(SgfTreeEqualityComparer.Instance)); }
public void Multiple_property_values() { var encoded = "(;A[b][c][d])"; var expected = new SgfTree(new Dictionary <string, string[]> { ["A"] = new[] { "b", "c", "d" } }); Assert.Equal(expected, SgfParser.ParseTree(encoded)); }
public void Escaped_property() { var encoded = "(;A[\\]b\\nc\\nd\\t\\te \\n\\]])"; var expected = new SgfTree(new Dictionary <string, string[]> { ["A"] = new[] { "]b\nc\nd e \n]" } }); AssertEqual(expected, SgfParser.ParseTree(encoded)); }
public void Single_node_tree() { var encoded = "(;A[B])"; var expected = new SgfTree(new Dictionary <string, string[]> { ["A"] = new[] { "B" } }); AssertEqual(expected, SgfParser.ParseTree(encoded)); }
public void Multiple_properties() { var encoded = "(;A[b]C[d])"; var expected = new SgfTree(new Dictionary <string, string[]> { ["A"] = new[] { "b" }, ["C"] = new[] { "d" } }); AssertEqual(expected, SgfParser.ParseTree(encoded)); }
public void Two_nodes() { var encoded = "(;A[B];B[C])"; var expected = new SgfTree(new Dictionary <string, string[]> { ["A"] = new[] { "B" } }, new SgfTree(new Dictionary <string, string[]> { ["B"] = new[] { "C" } })); AssertEqual(expected, SgfParser.ParseTree(encoded)); }
public void Two_child_trees() { const string input = "(;A[B](;B[C])(;C[D]))"; var expected = TreeWithChildren(CreateData("A", "B"), new[] { TreeWithNoChildren(CreateData("B", "C")), TreeWithNoChildren(CreateData("C", "D")) }); Assert.Equal(expected, SgfParser.ParseTree(input), SgfTreeEqualityComparer.Instance); }
public void Two_child_trees() { var encoded = "(;A[B](;B[C])(;C[D]))"; var expected = new SgfTree(new Dictionary <string, string[]> { ["A"] = new[] { "B" } }, new SgfTree(new Dictionary <string, string[]> { ["B"] = new[] { "C" } }), new SgfTree(new Dictionary <string, string[]> { ["C"] = new[] { "D" } })); AssertEqual(expected, SgfParser.ParseTree(encoded)); }
public void Tree_without_nodes() { const string input = "()"; Assert.That(() => SgfParser.ParseTree(input), Throws.Exception); }
public void Properties_without_delimiter() { const string input = "(;a)"; Assert.Throws <ArgumentException>(() => SgfParser.ParseTree(input)); }
public void Empty_input() { var encoded = ""; Assert.Throws <ArgumentException>(() => SgfParser.ParseTree(encoded)); }
public void Upper_and_lowercase_property() { var encoded = "(;Aa[b])"; Assert.Throws <ArgumentException>(() => SgfParser.ParseTree(encoded)); }
public void Node_without_tree() { const string input = ";"; Assert.That(() => SgfParser.ParseTree(input), Throws.Exception); }
public void Properties_without_delimiter() { var encoded = "(;A)"; Assert.Throws <ArgumentException>(() => SgfParser.ParseTree(encoded)); }
public void Upper_and_lowercase_property() { const string input = "(;Aa[b])"; Assert.That(() => SgfParser.ParseTree(input), Throws.Exception); }
public void Properties_without_delimiter() { const string input = "(;a)"; Assert.That(() => SgfParser.ParseTree(input), Throws.Exception); }
public void Tree_with_no_nodes() { var encoded = "()"; Assert.Throws <ArgumentException>(() => SgfParser.ParseTree(encoded)); }
public void Node_without_tree() { var encoded = ";"; Assert.Throws <ArgumentException>(() => SgfParser.ParseTree(encoded)); }
public void Empty_value() { const string input = ""; Assert.Throws <ArgumentException>(() => SgfParser.ParseTree(input)); }
public void Tree_without_nodes() { const string input = "()"; Assert.Throws <ArgumentException>(() => SgfParser.ParseTree(input)); }
public void Node_without_tree() { const string input = ";"; Assert.Throws <ArgumentException>(() => SgfParser.ParseTree(input)); }
public void Upper_and_lowercase_property() { const string input = "(;Aa[b])"; Assert.Throws <ArgumentException>(() => SgfParser.ParseTree(input)); }
public void Empty_value() { const string input = ""; Assert.That(() => SgfParser.ParseTree(input), Throws.Exception); }