示例#1
0
        public void GetHashCode_WithIdenticalCacheKeys_ReturnsTheSameValue([Values(0, 1, 2)] int stateKey, [Values(0, 1, 2)] int location)
        {
            var subjectA = new CacheKey("OK", stateKey, location);
            var subjectB = new CacheKey("OK", stateKey, location);

            Assert.That(subjectA.GetHashCode(), Is.EqualTo(subjectB.GetHashCode()));
        }
示例#2
0
        public void Equals_WithIdenticalCacheKeys_ReturnsTrue([Values(0, 1, 2)] int stateKey, [Values(0, 1, 2)] int location)
        {
            var subjectA = new CacheKey("OK", stateKey, location);
            var subjectB = new CacheKey("OK", stateKey, location);

            Assert.That(subjectA.Equals(subjectB), Is.True);
        }
示例#3
0
        public void Equals_WithNullReference_ReturnsFalse()
        {
            var subjectA = new CacheKey("OK", 0, 0);
            var subjectB = (CacheKey)null;

            Assert.That(subjectA.Equals(subjectB), Is.False);
        }
示例#4
0
        public void Equals_WithDifferentCacheKeys_ReturnsFalse()
        {
            var subjectA = new CacheKey("OK", 0, 0);
            var subjectB = new CacheKey("OK", 1, 0);

            Assert.That(subjectA.Equals(subjectB), Is.False);
        }