public void GetImage_WithCustomParameterlessDecoder_ShouldUtilizeCache <TPixel>(TestImageProvider <TPixel> provider)
            where TPixel : struct, IPixel <TPixel>
        {
            if (!TestEnvironment.Is64BitProcess)
            {
                // We don't cache with the 32 bit build.
                return;
            }

            Assert.NotNull(provider.Utility.SourceFileOrDescription);

            TestDecoder.DoTestThreadSafe(() =>
            {
                string testName = nameof(this.GetImage_WithCustomParameterlessDecoder_ShouldUtilizeCache);

                var decoder = new TestDecoder();
                decoder.InitCaller(testName);

                provider.GetImage(decoder);
                Assert.Equal(1, TestDecoder.GetInvocationCount(testName));

                provider.GetImage(decoder);
                Assert.Equal(1, TestDecoder.GetInvocationCount(testName));
            });
        }
Exemple #2
0
        public void GetImage_WithCustomParameterlessDecoder_ShouldUtilizeCache <TPixel>(TestImageProvider <TPixel> provider)
            where TPixel : struct, IPixel <TPixel>
        {
            Assert.NotNull(provider.Utility.SourceFileOrDescription);

            TestDecoder.DoTestThreadSafe(() =>
            {
                string testName = nameof(this.GetImage_WithCustomParameterlessDecoder_ShouldUtilizeCache);

                var decoder = new TestDecoder();
                decoder.InitCaller(testName);

                provider.GetImage(decoder);
                Assert.Equal(1, TestDecoder.GetInvocationCount(testName));

                provider.GetImage(decoder);
                Assert.Equal(1, TestDecoder.GetInvocationCount(testName));
            });
        }