/// <summary>
 /// Adds a cluster with the specified name to the graph.
 /// </summary>
 /// <param name="name">The name of the cluster to create.</param>
 /// <returns>
 /// A cluster expression for configuring the cluster.
 /// </returns>
 public IClusterExpression WithName(string name)
 {
     var expression = new ClusterExpression(graph);
     expression.Cluster.Name = name;
     graph.AddSubGraph(expression.Cluster);
     return expression;
 }
        private static void AssertAttributeAdded(Action<IClusterExpression> action, Type attributeType, object attributeValue, Action<ICluster> customAsserts)
        {
            var graph = new DirectedGraph();
            var expression = new ClusterExpression(graph);
            action(expression);

            var cluster = expression.Cluster;

            Assert.AreEqual(cluster.Attributes.CurrentAttributes.Count, 1);

            var attribute = cluster.Attributes.CurrentAttributes[0];
            Assert.IsInstanceOfType(attributeType, attribute);
            Assert.AreEqual(attribute.Value, attributeValue);

            if (customAsserts != null)
            {
                customAsserts(expression.Cluster);
            }
        }