예제 #1
0
        public void WhenReferencesAreNotEquivalent_ThenEqualsReturnsFalse()
        {
            var ref1 = new StorageObjectLocator("bucket-1", "object-1");
            var ref2 = new StorageObjectLocator("bucket-2", "object-1");

            Assert.IsFalse(ref1.Equals(ref2));
            Assert.IsFalse(ref1.Equals((object)ref2));
            Assert.IsFalse(ref1 == ref2);
            Assert.IsTrue(ref1 != ref2);
        }
예제 #2
0
        public void WhenReferencesAreSame_ThenEqualsReturnsTrue()
        {
            var ref1 = new StorageObjectLocator("proj", "object-1");
            var ref2 = ref1;

            Assert.IsTrue(ref1.Equals(ref2));
            Assert.IsTrue(ref1.Equals((object)ref2));
            Assert.IsTrue(ref1 == ref2);
            Assert.IsFalse(ref1 != ref2);
        }
예제 #3
0
        public void TestEqualsNull()
        {
            var ref1 = new StorageObjectLocator("proj", "object-1");

            Assert.IsFalse(ref1.Equals(null));
            Assert.IsFalse(ref1.Equals((object)null));
            Assert.IsFalse(ref1 == null);
            Assert.IsFalse(null == ref1);
            Assert.IsTrue(ref1 != null);
            Assert.IsTrue(null != ref1);
        }