示例#1
0
        public void Equality_SameVertex_IsTrue()
        {
            var vertex = new VertexIdx(0);
            var other  = new VertexIdx(0);

            Assert.That(vertex == other, Is.True);
        }
示例#2
0
        public void Inequality_OtherVertex_IsTrue()
        {
            var vertex = new VertexIdx(0);
            var other  = new VertexIdx(1);

            Assert.That(vertex != other, Is.True);
        }
示例#3
0
        /// <inheritdoc/>
        public VertexIdx AddVertex(TVertex vertex)
        {
            var vertexData = new VertexData {
                Data = vertex, StartIndex = -1, EdgeStorage = default
            };
            var index = new VertexIdx(this._vertices.Add(vertexData));

            return(index);
        }
示例#4
0
 /// <inheritdoc/>
 public void RemoveVertex(VertexIdx vertex)
 {
     ref var vertexData = ref this._vertices[vertex.Index];
示例#5
0
        public void ToString_FormattedAsDefined()
        {
            var vertex = new VertexIdx(42);

            Assert.That(vertex.ToString(), Is.EqualTo("#42"));
        }
示例#6
0
        public void Equals_SomeObject_IsFalse()
        {
            var vertex = new VertexIdx(0);

            Assert.That(vertex.Equals(new object()), Is.False);
        }
示例#7
0
        public void Equals_Null_IsFalse()
        {
            var vertex = new VertexIdx(0);

            Assert.That(vertex.Equals(null), Is.False);
        }
示例#8
0
        public void Equals_SameVertexObject_IsTrue()
        {
            var vertex = new VertexIdx(0);

            Assert.That(vertex.Equals((object)new VertexIdx(0)), Is.True);
        }
示例#9
0
        public void Equals_OtherVertex_IsFalse()
        {
            var vertex = new VertexIdx(0);

            Assert.That(vertex.Equals(new VertexIdx(1)), Is.False);
        }
示例#10
0
        public void Index_IsAsConstructed()
        {
            var vertex = new VertexIdx(42);

            Assert.That(vertex.Index, Is.EqualTo(42));
        }