public void AddEdmToClrMap_Cached_OnlyOneInstance()
        {
            // Arrange
            TypeCacheItem cache   = new TypeCacheItem();
            IEdmType      edmType = new Mock <IEdmType>().Object;

            Action cacheCallAndVerify = () =>
            {
                cache.AddEdmToClrMap(edmType, true, typeof(int?));
                cache.AddEdmToClrMap(edmType, false, typeof(int));

                KeyValuePair <IEdmType, (Type, Type)> item = Assert.Single(cache.EdmToClrTypeCache);
                Assert.Same(edmType, item.Key);
                Assert.Equal(typeof(int), item.Value.Item1);
                Assert.Equal(typeof(int?), item.Value.Item2);
            };
        public void AddAndGetClrType_Returns_CorrectType(Type testType)
        {
            // Arrange
            IEdmType      edmType = new Mock <IEdmType>().Object;
            TypeCacheItem cache   = new TypeCacheItem();

            // Act
            bool found = cache.TryFindClrType(edmType, true, out _);

            Assert.False(found);

            cache.AddEdmToClrMap(edmType, true, testType);

            found = cache.TryFindClrType(edmType, true, out Type actualType);

            // Act & Assert
            Assert.True(found);
            Assert.Same(testType, actualType);
        }