public void GlobalSetup() { _compoundKey = new CompoundKey { Integer = new Random(42).Next(), String = Guid.NewGuid().ToString("N") }; _compoundKeyObject = _compoundKey; _compoundKeyCacheKeyA = _compoundKey; _compoundKeyCacheKeyB = _compoundKey; _integerObject = _compoundKey.Integer; _integerCacheKeyA = _compoundKey.Integer; _integerCacheKeyB = _compoundKey.Integer; _stringObject = _compoundKey.String; _stringCacheKeyA = new CacheKeyA <CompoundKey>(_compoundKey.String); _stringCacheKeyB = _compoundKey.String; }
public bool Equals(CacheKeyB <TKey> other) { if (_keyType == other._keyType) { if (_keyType == CacheKeyType.IntegerKey) { return(_integerKey.Equals(other._integerKey)); } if (_keyType == CacheKeyType.StringKey) { return(_stringKey.Equals(other._stringKey)); } return(_originKey.Equals(other._originKey)); } return(false); }