Esempio n. 1
0
        public void TestThatFileIsEncodedThenDecodedCorrectly2(NearLosslessPredictorType predictorType)
        {
            var filepathImage = $"{Environment.CurrentDirectory}\\Images\\Peppers256an.bmp";

            TestMethods.CopyFileAndReplaceIfAlreadyExists(filepathImage, filepathSource);

            encoder.Encode(filepathSource, filepathEncodedFile, GetOptions(predictorType));
            decoder.Decode(filepathEncodedFile, filepathDecodedFile);

            Assert.IsTrue(TestMethods.FilesHaveTheSameContent(filepathSource, filepathDecodedFile));
        }
Esempio n. 2
0
        public FileReaderPlusFileWriterBenchmarks()
        {
            var serviceProvider = DependencyResolver.GetServices().BuildServiceProvider();

            fileReader = serviceProvider.GetRequiredService <IFileReader>();
            fileWriter = serviceProvider.GetRequiredService <IFileWriter>();

            filepathSource      = $"{Environment.CurrentDirectory}\\{Constants.TestFileNameImage}";
            filepathDestination = $"{Environment.CurrentDirectory}\\{Constants.TestFileNameImageDestination}";

            TestMethods.CopyFileAndReplaceIfAlreadyExists($"{Environment.CurrentDirectory}\\Resources\\{Constants.TestFileNameImage}", filepathSource);
        }
Esempio n. 3
0
        public void Setup()
        {
            var dependencyResolver = new DependencyResolver();

            imagePredictionEncoder = (ImagePredictionEncoder)dependencyResolver.GetObject <IImagePredictionEncoder>();
            imagePredictionDecoder = (ImagePredictionDecoder)dependencyResolver.GetObject <IImagePredictionDecoder>();

            filePathSource      = $"{Environment.CurrentDirectory}\\temp.bmp";
            filePathEncodedFile = $"{Environment.CurrentDirectory}\\temp.bmp.pre";
            filePathDecodedFile = $"{Environment.CurrentDirectory}\\temp.png.pre.bmp";

            TestMethods.CopyFileAndReplaceIfAlreadyExists($"{Environment.CurrentDirectory}\\Images\\TestImage1.bmp", filePathSource);
        }
Esempio n. 4
0
        public void Setup()
        {
            var dependencyResolver = new DependencyResolver();

            jpegEncoder = (JpegEncoder)dependencyResolver.GetObject <IJpegEncoder>();
            downSampler = new DownSampler411();

            filePathSource      = $"{Environment.CurrentDirectory}\\temp.bmp";
            filePathEncodedFile = $"{Environment.CurrentDirectory}\\temp.bmp.pre";
            filePathDecodedFile = $"{Environment.CurrentDirectory}\\temp.png.pre.jpg";

            TestMethods.CopyFileAndReplaceIfAlreadyExists($"{Environment.CurrentDirectory}\\Images\\TestImage1.bmp", filePathSource);
        }