GetCacheKey() public method

Resolve cache key
public GetCacheKey ( _IInvocation invocation, object>.IDictionary invocationContext ) : string
invocation _IInvocation
invocationContext object>.IDictionary
return string
        public void Should_build_key_from_methodInfo_and_context()
        {
            // Arrange
            var invocation = Substitute.For<_IInvocation>();
            invocation.Arguments.Returns(new object[] {new Guid ("5e31d440-c9f8-4110-b94d-fdf8affdc675") });
            invocation.GetArgumentValue(Arg.Any<int>()).Returns(ct => invocation.Arguments[ct.Arg<int>()]);
            invocation.Method.Returns(typeof(IUserService).GetMethod(nameof(IUserService.GetById), BindingFlags.Instance | BindingFlags.Public));

            var provider = new DefaultCacheKeyProvider();
            var invocationContext = new Dictionary<string, object>();
            invocationContext[Global.__flatwhite_outputcache_attribute] = new OutputCacheAttribute
            {
                VaryByCustom = "query.source, headers.UserAgent, headers.CacheControl.Public, headers.CacheControl.NonExistProperty",
                VaryByParam = "userId"
            };
            invocationContext["query"] = new Dictionary<string, object>
            {
                { "source","a"},
                { "source2","b"},
            };
            var r = new HttpRequestMessage();
            r.Headers.CacheControl = new CacheControlHeaderValue
            {
                Public = true
            };
            r.Headers.Add("User-Agent", "Flatwhite.UnitTest");
            invocationContext["headers"] = r.Headers;

            // Action
            var key = provider.GetCacheKey(invocation, invocationContext);

            // Assert
            Assert.AreEqual("Flatwhite::Flatwhite.Tests.IUserService.GetById(Guid:5e31d440-c9f8-4110-b94d-fdf8affdc675) ::  query.source:a,  headers.UserAgent:Flatwhite.UnitTest,  headers.CacheControl.Public:True, , ", key);
        }