Example #1
0
        public void DefaultValues()
        {
            var sut = new MethodReference();

            Assert.AreEqual(new VariableReference(), sut.Reference);
            Assert.AreEqual(Names.UnknownMethod, sut.MethodName);
            Assert.AreNotEqual(0, sut.GetHashCode());
            Assert.AreNotEqual(1, sut.GetHashCode());
        }
Example #2
0
        public void Equality_Default()
        {
            var a = new MethodReference();
            var b = new MethodReference();

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }
Example #3
0
        public void Equality_DifferentReference()
        {
            var a = new MethodReference {
                Reference = SomeRef
            };
            var b = new MethodReference();

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
Example #4
0
        public void Equality_ReallyTheSame()
        {
            var a = new MethodReference
            {
                Reference  = SomeRef,
                MethodName = SomeMethod
            };
            var b = new MethodReference
            {
                Reference  = SomeRef,
                MethodName = SomeMethod
            };

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }
 public int GetHashCode(MethodReference obj)
 => obj.GetHashCode();