public void Problem3Serialize_RootIsNull_ReturnsExpectedString() { const string expected = "null,"; BinaryNode nodeTree = null; string serializedNodeTree = Problems1Through25.Problem3Serialize(nodeTree); Assert.Equal(expected, serializedNodeTree); }
public void Problem3Serialize_RootOnlyTree_ReturnsExpectedString() { const string expected = "0,null,null,"; var nodeTree = new BinaryNode(0); string serializedNodeTree = Problems1Through25.Problem3Serialize(nodeTree); Assert.Equal(expected, serializedNodeTree); }
public void Problem3Serialize_Full2LayeredTree_ReturnsExpectedString() { const string expected = "0,1,null,null,2,null,null,"; var nodeTree = new BinaryNode( 0, new BinaryNode(1), new BinaryNode(2)); string serializedNodeTree = Problems1Through25.Problem3Serialize(nodeTree); Assert.Equal(expected, serializedNodeTree); }