예제 #1
0
        public void ImageLoadingLoadImageFromBuffer()
        {
            tlog.Debug(tag, $"ImageLoadingLoadImageFromBuffer  START");

            var stream = FileToStream(image_path);

            var testingTarget = ImageLoading.LoadImageFromBuffer(stream);

            Assert.IsNotNull(testingTarget, "Can't create success object PixelBuffer.");
            Assert.IsInstanceOf <PixelBuffer>(testingTarget, "Should return PixelBuffer instance.");

            testingTarget.Dispose();
            tlog.Debug(tag, $"ImageLoadingLoadImageFromBuffer  END (OK)");
        }
예제 #2
0
        public void ImageLoadingLoadImageFromBufferWithNullBuffer()
        {
            tlog.Debug(tag, $"ImageLoadingLoadImageFromBufferWithNullBuffer START");

            try
            {
                ImageLoading.LoadImageFromBuffer(null);
            }
            catch (ArgumentNullException e)
            {
                tlog.Debug(tag, e.Message.ToString());
                tlog.Debug(tag, $"ImageLoadingLoadImageFromBufferWithNullBuffer END (OK)");
                Assert.Pass("Caught ArgumentNullException :  Passed!");
            }
        }
예제 #3
0
        public void ImageLoadingLoadImageFromBufferWithOrientationCorrection()
        {
            tlog.Debug(tag, $"ImageLoadingLoadImageFromBufferWithOrientationCorrection START");

            var stream = FileToStream(imageurl);

            using (Size2D size2d = new Size2D(NUIApplication.GetDefaultWindow().WindowSize.Width, NUIApplication.GetDefaultWindow().WindowSize.Height))
            {
                var testingTarget = ImageLoading.LoadImageFromBuffer(stream, size2d, FittingModeType.ScaleToFill, SamplingModeType.Linear, true);
                Assert.IsNotNull(testingTarget, "Can't create success object PixelBuffer.");
                Assert.IsInstanceOf <PixelBuffer>(testingTarget, "Should return PixelBuffer instance.");

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ImageLoadingLoadImageFromBufferWithOrientationCorrection END (OK)");
        }
예제 #4
0
        public void ImageLoadingLoadImageFromBufferWithSizeNullSize()
        {
            tlog.Debug(tag, $"ImageLoadingLoadImageFromBufferWithSizeNullSize START");

            var stream = FileToStream(image_path);

            try
            {
                ImageLoading.LoadImageFromBuffer(stream, null);
            }
            catch (ArgumentNullException e)
            {
                tlog.Debug(tag, e.Message.ToString());
                tlog.Debug(tag, $"ImageLoadingLoadImageFromBufferWithSizeNullSize END (OK)");
                Assert.Pass("Caught ArgumentNullException :  Passed!");
            }
        }
예제 #5
0
        public void ImageLoadingLoadImageFromBufferWithSize()
        {
            tlog.Debug(tag, $"ImageLoadingLoadImageFromBufferWithSize  START");

            var stream = FileToStream(image_path);

            using (Size2D size2d = new Size2D(NUIApplication.GetDefaultWindow().WindowSize.Width, NUIApplication.GetDefaultWindow().WindowSize.Height))
            {
                var testingTarget = ImageLoading.LoadImageFromBuffer(stream, size2d);
                Assert.IsNotNull(testingTarget, "Can't create success object PixelBuffer.");
                Assert.IsInstanceOf <PixelBuffer>(testingTarget, "Should return PixelBuffer instance.");

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ImageLoadingLoadImageFromBufferWithSize  END (OK)");
        }
예제 #6
0
        public void ImageLoadingLoadImageFromBufferWithOrientationCorrectionNullSize()
        {
            tlog.Debug(tag, $"ImageLoadingLoadImageFromBufferWithOrientationCorrectionNullSize START");

            var stream = FileToStream(image_path);

            try
            {
                ImageLoading.LoadImageFromBuffer(stream, null, FittingModeType.ScaleToFill, SamplingModeType.Linear, true);;
            }
            catch (ArgumentNullException e)
            {
                tlog.Debug(tag, e.Message.ToString());
                tlog.Debug(tag, $"ImageLoadingLoadImageFromBufferWithOrientationCorrectionNullSize END (OK)");
                Assert.Pass("Caught ArgumentNullException :  Passed!");
            }
        }
예제 #7
0
        public void ImageLoadingLoadImageFromBufferWithSizeNullBuffer()
        {
            tlog.Debug(tag, $"ImageLoadingLoadImageFromBufferWithSizeNullBuffer START");

            using (Size2D size2d = new Size2D(NUIApplication.GetDefaultWindow().WindowSize.Width, NUIApplication.GetDefaultWindow().WindowSize.Height))
            {
                try
                {
                    ImageLoading.LoadImageFromBuffer(null, size2d);
                }
                catch (ArgumentNullException e)
                {
                    tlog.Debug(tag, e.Message.ToString());
                    tlog.Debug(tag, $"ImageLoadingLoadImageFromBufferWithSizeNullBuffer END (OK)");
                    Assert.Pass("Caught ArgumentNullException :  Passed!");
                }
            }
        }
예제 #8
0
        public void ImageLoadingLoadImageFromBufferWithOrientationCorrectionNullBuffer()
        {
            tlog.Debug(tag, $"ImageLoadingLoadImageFromBufferWithOrientationCorrectionNullBuffer START");

            using (Size2D size2d = new Size2D(NUIApplication.GetDefaultWindow().WindowSize.Width, NUIApplication.GetDefaultWindow().WindowSize.Height))
            {
                try
                {
                    ImageLoading.LoadImageFromBuffer(null, size2d, FittingModeType.ScaleToFill, SamplingModeType.Linear, true);
                }
                catch (ArgumentNullException e)
                {
                    tlog.Debug(tag, e.Message.ToString());
                    tlog.Debug(tag, $"ImageLoadingLoadImageFromBufferWithOrientationCorrectionNullBuffer END (OK)");
                    Assert.Pass("Caught ArgumentNullException :  Passed!");
                }
            }
        }