Beispiel #1
0
        public void EqualsWithOtherType()
        {
            var id = new ObjectID("Official", 42);

            Assert.That(id.Equals(new ObjectIDTest()), Is.False);
            Assert.That(id.Equals(42), Is.False);
        }
Beispiel #2
0
        public void TestEqualsForValue()
        {
            var id1 = new ObjectID("Official", 42);
            var id2 = new ObjectID("Official", 42);
            var id3 = new ObjectID("Official", 41);

            Assert.That(id1.Equals(id2), Is.True);
            Assert.That(id1.Equals(id3), Is.False);
            Assert.That(id2.Equals(id3), Is.False);
            Assert.That(id2.Equals(id1), Is.True);
            Assert.That(id3.Equals(id1), Is.False);
            Assert.That(id3.Equals(id2), Is.False);
        }
Beispiel #3
0
        public void StaticNotEquals()
        {
            var id1 = new ObjectID("Official", 42);
            var id2 = new ObjectID("SpecialOfficial", 1);

            Assert.That(ObjectID.Equals(id1, id2), Is.False);
        }
Beispiel #4
0
        public void StaticEquals()
        {
            var id1 = new ObjectID("Official", 42);
            var id2 = new ObjectID("Official", 42);

            Assert.That(ObjectID.Equals(id1, id2), Is.True);
        }
Beispiel #5
0
        public override bool Equals(object obj)
        {
            var other = obj as RoleObject;

            if (other == null)
            {
                return(false);
            }
            return(RoleID.Equals(other.RoleID) && ObjectID.Equals(other.ObjectID));
        }
Beispiel #6
0
        public void EqualsWithNull()
        {
            var id = new ObjectID("Official", 42);

            Assert.That(id.Equals(null), Is.False);
        }