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 AfterTest()
 {
     container.Dispose();
     container                = null;
     testFilePath             = null;
     config                   = null;
     encoder                  = null;
     decoder                  = null;
     moduleManagerMock        = null;
     configurationManagerMock = null;
     fileSystemMock           = null;
     bootstrapperMock         = null;
 }
Exemple #3
0
        public void BeforeTest()
        {
            container    = new CompositionContainer();
            testFilePath = new FilePath(@"C:\test", true);
            config       = new SessionConfiguration();
            encoder      = new TestEncoder();
            decoder      = new TestDecoder();

            moduleManagerMock        = new Mock <IModuleManager>();
            configurationManagerMock = new Mock <IConfigurationManager>();
            fileSystemMock           = new MockFileSystem();
            bootstrapperMock         = new Mock <IBootstrapper>();

            var hookMock = new HookNativeMethodsMock();

            hookMock.AllowLibraryLoad();
        }
Exemple #4
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));
            });
        }