public void ImageLoadingDownloadImageSynchronously() { tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronously START"); var testingTarget = ImageLoading.DownloadImageSynchronously(bmp_path); Assert.IsNotNull(testingTarget, "Can't create success object PixelBuffer."); Assert.IsInstanceOf <PixelBuffer>(testingTarget, "Should return PixelBuffer instance."); testingTarget.Dispose(); tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronously END (OK)"); }
public void ImageLoadingDownloadImageSynchronouslyWithOrientationCorrection() { tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyWithOrientationCorrection START"); using (Size2D size2d = new Size2D(NUIApplication.GetDefaultWindow().WindowSize.Width, NUIApplication.GetDefaultWindow().WindowSize.Height)) { var testingTarget = ImageLoading.DownloadImageSynchronously(bmp_path, size2d, FittingModeType.Center, SamplingModeType.DontCare, true); Assert.IsNotNull(testingTarget, "Can't create success object PixelBuffer."); Assert.IsInstanceOf <PixelBuffer>(testingTarget, "Should return PixelBuffer instance."); testingTarget.Dispose(); } tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyWithOrientationCorrection END (OK)"); }
public void ImageLoadingDownloadImageSynchronouslyByNullUrl() { tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyByNullUrl START"); try { using (Size2D size2d = new Size2D(NUIApplication.GetDefaultWindow().WindowSize.Width, NUIApplication.GetDefaultWindow().WindowSize.Height)) { Uri uri = null; ImageLoading.DownloadImageSynchronously(uri, size2d, FittingModeType.Center); } } catch (ArgumentNullException) { tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyByNullUrl END (OK)"); Assert.Pass("Caught ArgumentNullException : Passed!"); } }
public void ImageLoadingDownloadImageSynchronouslyByUrl() { tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyByUrl START"); using (Size2D size2d = new Size2D(NUIApplication.GetDefaultWindow().WindowSize.Width, NUIApplication.GetDefaultWindow().WindowSize.Height)) { var testingTarget = ImageLoading.DownloadImageSynchronously(new Uri(bmp_path), size2d, FittingModeType.Center); Assert.IsNotNull(testingTarget, "Can't create success object PixelBuffer."); Assert.IsInstanceOf <PixelBuffer>(testingTarget, "Should return PixelBuffer instance."); testingTarget.Dispose(); } try { ImageLoading.DownloadImageSynchronously(new Uri(bmp_path), null, FittingModeType.FitHeight); } catch (ArgumentNullException) { tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyByUrl END (OK)"); Assert.Pass("Caught ArgumentNullException : Passed!"); } }