//[Fact]
        public void CacheCode()
        {
            var hashes = new Dictionary <int, List <String> >();

            SelectTestDefinition[] requestMethodNames = SelectTestDefinition.GetSelectTestDefinitions();

            var fixture = new DbFixtureInitDb();
            var parser  = new OeGetParser(fixture.OeDataAdapter, fixture.EdmModel);

            for (int i = 0; i < requestMethodNames.Length; i++)
            {
                OeQueryContext queryContext = parser.CreateQueryContext(fixture.ParseUri(requestMethodNames[i].Request), 0, false, OeMetadataLevel.Minimal);
                int            hash         = OeCacheComparer.GetCacheCode(queryContext.CreateCacheContext());
                if (!hashes.TryGetValue(hash, out List <String> value))
                {
                    value = new List <String>();
                    hashes.Add(hash, value);
                }
                value.Add(requestMethodNames[i].MethodName);
            }

            var duplicate = hashes.Where(p => p.Value.Count > 1).Select(p => p.Value).ToArray();
        }
Ejemplo n.º 2
0
 public int GetHashCode(OeCacheContext obj)
 {
     return(OeCacheComparer.GetCacheCode(obj));
 }