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)); }); }
public void AfterTest() { container.Dispose(); container = null; testFilePath = null; config = null; encoder = null; decoder = null; moduleManagerMock = null; configurationManagerMock = null; fileSystemMock = null; bootstrapperMock = null; }
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(); }
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)); }); }