Esempio n. 1
0
        public void Constructor()
        {
            var layer = new GraphvizLayer("TestLayer");

            Assert.AreEqual("TestLayer", layer.Name);

            layer = new GraphvizLayer("OtherLayer");
            Assert.AreEqual("OtherLayer", layer.Name);
        }
Esempio n. 2
0
        public void Name_Throws()
        {
            var layer = new GraphvizLayer("Layer");

            // ReSharper disable ObjectCreationAsStatement
            // ReSharper disable once AssignNullToNotNullAttribute
            Assert.Throws <ArgumentException>(() => layer.Name = null);
            Assert.Throws <ArgumentException>(() => layer.Name = "");
            // ReSharper restore ObjectCreationAsStatement
        }
Esempio n. 3
0
        public void Name()
        {
            var layer = new GraphvizLayer("Layer");

            if (layer.Name != "Layer")
            {
                throw new InvalidOperationException("Layer has wong name.");
            }

            layer.Name = "LayerUpdated";
            Assert.AreEqual("LayerUpdated", layer.Name);
        }
        public void Constructor()
        {
            var layerCollection = new GraphvizLayerCollection();

            CollectionAssert.IsEmpty(layerCollection);
            Assert.AreEqual(":", layerCollection.Separators);

            var layer1 = new GraphvizLayer("L1");

            layerCollection.Add(layer1);
            CollectionAssert.AreEqual(new[] { layer1 }, layerCollection);

            var layer2     = new GraphvizLayer("L2");
            var layerArray = new[] { layer1, layer2 };

            layerCollection = new GraphvizLayerCollection(layerArray);
            CollectionAssert.AreEqual(layerArray, layerCollection);
            Assert.AreEqual(":", layerCollection.Separators);

            var otherLayerCollection = new GraphvizLayerCollection(layerCollection);

            CollectionAssert.AreEqual(layerCollection, otherLayerCollection);
            Assert.AreEqual(":", otherLayerCollection.Separators);
        }
 /// <summary>
 /// Initializes a new instance of the GraphvizLayerCollection class, containing elements
 /// copied from an array.
 /// </summary>
 /// <param name="items">
 /// The array whose elements are to be added to the new GraphvizLayerCollection.
 /// </param>
 public GraphvizLayerCollection(GraphvizLayer[] items)
 {
     m_Separators = ":";
     this.AddRange(items);
 }
 /// <summary>
 /// Removes the first occurrence of a specific GraphvizLayer from this GraphvizLayerCollection.
 /// </summary>
 /// <param name="value">
 /// The GraphvizLayer value to remove from this GraphvizLayerCollection.
 /// </param>
 public virtual void Remove(GraphvizLayer value)
 {
     this.List.Remove(value);
 }
 /// <summary>
 /// Inserts an element into the GraphvizLayerCollection at the specified index
 /// </summary>
 /// <param name="index">
 /// The index at which the GraphvizLayer is to be inserted.
 /// </param>
 /// <param name="value">
 /// The GraphvizLayer to insert.
 /// </param>
 public virtual void Insert(int index, GraphvizLayer value)
 {
     this.List.Insert(index, value);
 }
 /// <summary>
 /// Return the zero-based index of the first occurrence of a specific value
 /// in this GraphvizLayerCollection
 /// </summary>
 /// <param name="value">
 /// The GraphvizLayer value to locate in the GraphvizLayerCollection.
 /// </param>
 /// <returns>
 /// The zero-based index of the first occurrence of the _ELEMENT value if found;
 /// -1 otherwise.
 /// </returns>
 public virtual int IndexOf(GraphvizLayer value)
 {
     return this.List.IndexOf(value);
 }
 /// <summary>
 /// Determines whether a specfic GraphvizLayer value is in this GraphvizLayerCollection.
 /// </summary>
 /// <param name="value">
 /// The GraphvizLayer value to locate in this GraphvizLayerCollection.
 /// </param>
 /// <returns>
 /// true if value is found in this GraphvizLayerCollection;
 /// false otherwise.
 /// </returns>
 public virtual bool Contains(GraphvizLayer value)
 {
     return this.List.Contains(value);
 }
Esempio n. 10
0
 /// <summary>
 /// Adds the elements of an array to the end of this GraphvizLayerCollection.
 /// </summary>
 /// <param name="items">
 /// The array whose elements are to be added to the end of this GraphvizLayerCollection.
 /// </param>
 public virtual void AddRange(GraphvizLayer[] items)
 {
     foreach (GraphvizLayer item in items)
     {
         this.List.Add(item);
     }
 }
Esempio n. 11
0
 /// <summary>
 /// Adds an instance of type GraphvizLayer to the end of this GraphvizLayerCollection.
 /// </summary>
 /// <param name="value">
 /// The GraphvizLayer to be added to the end of this GraphvizLayerCollection.
 /// </param>
 public virtual void Add(GraphvizLayer value)
 {
     this.List.Add(value);
 }
Esempio n. 12
0
 /// <summary>
 /// Removes the first occurrence of a specific GraphvizLayer from this GraphvizLayerCollection.
 /// </summary>
 /// <param name="value">
 /// The GraphvizLayer value to remove from this GraphvizLayerCollection.
 /// </param>
 public virtual void Remove(GraphvizLayer value)
 {
     this.List.Remove(value);
 }
Esempio n. 13
0
 /// <summary>
 /// Inserts an element into the GraphvizLayerCollection at the specified index
 /// </summary>
 /// <param name="index">
 /// The index at which the GraphvizLayer is to be inserted.
 /// </param>
 /// <param name="value">
 /// The GraphvizLayer to insert.
 /// </param>
 public virtual void Insert(int index, GraphvizLayer value)
 {
     this.List.Insert(index, value);
 }
Esempio n. 14
0
 /// <summary>
 /// Return the zero-based index of the first occurrence of a specific value
 /// in this GraphvizLayerCollection
 /// </summary>
 /// <param name="value">
 /// The GraphvizLayer value to locate in the GraphvizLayerCollection.
 /// </param>
 /// <returns>
 /// The zero-based index of the first occurrence of the _ELEMENT value if found;
 /// -1 otherwise.
 /// </returns>
 public virtual int IndexOf(GraphvizLayer value)
 {
     return(this.List.IndexOf(value));
 }
Esempio n. 15
0
 /// <summary>
 /// Determines whether a specfic GraphvizLayer value is in this GraphvizLayerCollection.
 /// </summary>
 /// <param name="value">
 /// The GraphvizLayer value to locate in this GraphvizLayerCollection.
 /// </param>
 /// <returns>
 /// true if value is found in this GraphvizLayerCollection;
 /// false otherwise.
 /// </returns>
 public virtual bool Contains(GraphvizLayer value)
 {
     return(this.List.Contains(value));
 }
Esempio n. 16
0
 /// <summary>
 /// Adds an instance of type GraphvizLayer to the end of this GraphvizLayerCollection.
 /// </summary>
 /// <param name="value">
 /// The GraphvizLayer to be added to the end of this GraphvizLayerCollection.
 /// </param>
 public virtual void Add(GraphvizLayer value)
 {
     this.List.Add(value);
 }