Exemplo n.º 1
0
        public void GetCacheKey_FormatsCacheKey_WhenEnumerableOutputIsDefined_AndNoParameters()
        {
            var model      = new TestModelDefinition();
            var methodInfo = model.GetType().GetMethod(nameof(model.TestMethod_EnumerableReturn));

            var result         = CacheKeyGenerationService.GetCacheKey(methodInfo, null);
            var expectedResult = $"Cash.Core.Tests.Models.TestModelDefinition.TestMethod_EnumerableReturn<Int32>({NullOrZeroArgumentsResult})";

            Assert.AreEqual(expectedResult, result);
        }
Exemplo n.º 2
0
        public void GetCacheKey_FormatsCacheKey_WhenEnumerableParameterIsDefined()
        {
            var model      = new TestModelDefinition();
            var methodInfo = model.GetType().GetMethod(nameof(model.TestMethod_EnumerableParameter));

            var result         = CacheKeyGenerationService.GetCacheKey(methodInfo, new object[] { 10, 20 });
            var expectedResult = $"Cash.Core.Tests.Models.TestModelDefinition.TestMethod_EnumerableParameter(Int32::10||Int32::20)";

            Assert.AreEqual(expectedResult, result);
        }