Пример #1
0
        public void Equals_CompareToSameArc_ReturnsTrue()
        {
            // arrange
            StubPlace sourcePlace = new StubPlace("sourcePlace", new List<INode> { }, new List<INode> { });
            StubTransition targetTrans = new StubTransition("targetTrans", new List<INode> { }, new List<INode> { });
            Arc testArc = new Arc(sourcePlace, targetTrans, "testArc");

            // act
            bool result = testArc.Equals(testArc);

            // assert
            Assert.IsTrue(result, "Comparison with same arc should return true.");
        }
Пример #2
0
        public void Equals_CompareToString_ReturnsFalse()
        {
            // arrange
            StubPlace sourcePlace = new StubPlace("sourcePlace", new List<INode> { }, new List<INode> { });
            StubTransition targetTrans = new StubTransition("targetTrans", new List<INode> { }, new List<INode> { });
            Arc testArc = new Arc(sourcePlace, targetTrans, "testArc");

            // act
            bool result = testArc.Equals("testString");

            // assert
            Assert.IsFalse(result, "Comparison with other type should always return false.");
        }
Пример #3
0
        public void Equals_CompareToDifferentArc_ReturnsFalse()
        {
            // arrange
            StubPlace sourcePlace = new StubPlace("sourcePlace", new List<INode> { }, new List<INode> { });
            StubTransition targetTrans = new StubTransition("targetTrans", new List<INode> { }, new List<INode> { });
            Arc testArc = new Arc(sourcePlace, targetTrans, "testArc");
            Arc differentArc = new Arc(sourcePlace, targetTrans, "differentArc");

            // act
            bool result = testArc.Equals(differentArc);

            // assert
            Assert.IsFalse(result, "Comparison with arc with different id should return false.");
        }