Exemple #1
0
        public void T_Equals_WithObject_True_SameReference()
        {
            // Arrange
            Cell cell  = new Cell();
            Cell cell2 = new Cell();

            cell.Value  = '1';
            cell2.Value = 'A';
            GraphNode graphNodeBgn = new GraphNode(cell);
            GraphNode graphNodeEnd = new GraphNode(cell2);
            GraphArc  graphArc     = new GraphArc(graphNodeBgn, graphNodeEnd);

            // Act
            bool isEqual = graphArc.Equals((Object)graphArc);

            // Assert
            Assert.IsTrue(isEqual);
        }
Exemple #2
0
        public void T_Equals_WithObject_False_DifferentTypes()
        {
            // Arrange
            Cell cell  = new Cell();
            Cell cell2 = new Cell();

            cell.Value  = '1';
            cell2.Value = 'A';
            GraphNode graphNodeBgn = new GraphNode(cell);
            GraphNode graphNodeEnd = new GraphNode(cell2);
            GraphArc  graphArc     = new GraphArc(graphNodeBgn, graphNodeEnd);

            // Act
            bool isEqual = graphArc.Equals(graphNodeBgn);

            // Assert
            Assert.IsFalse(isEqual);
        }
Exemple #3
0
        public void T_Equals_True()
        {
            // Arrange
            Cell cell  = new Cell();
            Cell cell2 = new Cell();

            cell.Value  = '1';
            cell2.Value = 'A';
            GraphNode graphNodeBgn  = new GraphNode(cell);
            GraphNode graphNodeEnd  = new GraphNode(cell2);
            GraphNode graphNodeBgn2 = new GraphNode(cell);
            GraphNode graphNodeEnd2 = new GraphNode(cell2);
            GraphArc  graphArc      = new GraphArc(graphNodeBgn, graphNodeEnd);
            GraphArc  graphArc2     = new GraphArc(graphNodeBgn2, graphNodeEnd2);

            // Act
            bool isEqual = graphArc.Equals(graphArc2);

            // Assert
            Assert.IsTrue(isEqual);
        }