public void TestCacheAccess() { var a0 = BlobAssetReference <int> .Create(0); var a1 = BlobAssetReference <int> .Create(1); var a2 = BlobAssetReference <float> .Create(2.0f); var k0 = FromInt(a0.Value); var k1 = FromInt(a1.Value); var k2 = FromFloat(a2.Value); Assert.IsTrue(m_Store.TryAdd(k0, a0)); Assert.IsFalse(m_Store.TryAdd(k0, a0)); Assert.IsTrue(m_Store.TryGet <int>(k0, out var ra0)); Assert.AreEqual(0, ra0.Value); Assert.AreEqual(0, m_Store.CacheMiss); Assert.AreEqual(1, m_Store.CacheHit); Assert.IsFalse(m_Store.TryGet <int>(k1, out var ra1)); Assert.IsTrue(m_Store.TryAdd(k1, a1)); Assert.IsTrue(m_Store.TryGet <int>(k1, out ra1)); Assert.AreEqual(1, ra1.Value); Assert.AreEqual(1, m_Store.CacheMiss); Assert.AreEqual(2, m_Store.CacheHit); Assert.IsFalse(m_Store.TryGet <float>(k2, out var ra2)); Assert.IsTrue(m_Store.TryAdd(k2, a2)); Assert.IsTrue(m_Store.TryGet(k2, out ra2)); Assert.AreEqual(2.0f, ra2.Value); Assert.AreEqual(2, m_Store.CacheMiss); Assert.AreEqual(3, m_Store.CacheHit); }