コード例 #1
0
ファイル: GraphvizLayerTests.cs プロジェクト: swidz/QuikGraph
        public void Constructor()
        {
            var layer = new GraphvizLayer("TestLayer");

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

            layer = new GraphvizLayer("OtherLayer");
            Assert.AreEqual("OtherLayer", layer.Name);
        }
コード例 #2
0
ファイル: GraphvizLayerTests.cs プロジェクト: swidz/QuikGraph
        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
        }
コード例 #3
0
ファイル: GraphvizLayerTests.cs プロジェクト: swidz/QuikGraph
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 /// <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);
 }
コード例 #6
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);
 }
コード例 #7
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);
 }
コード例 #8
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);
 }
コード例 #9
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);
 }
コード例 #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);
     }
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #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);
 }