From 4631a9e62c7e7557c0ff3562675afd523698d60d Mon Sep 17 00:00:00 2001 From: Federico Maccaroni Date: Thu, 8 Feb 2024 12:31:52 -0300 Subject: [PATCH] PM-3349 PM-3350 Fixed Unit tests because of referencing FFImageLoading when it's not possible --- src/Core/Controls/CachedImage.cs | 5 +++++ src/Core/Controls/CipherViewCell/BaseCipherViewCell.cs | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/src/Core/Controls/CachedImage.cs b/src/Core/Controls/CachedImage.cs index da4917d81..3f95dc1bf 100644 --- a/src/Core/Controls/CachedImage.cs +++ b/src/Core/Controls/CachedImage.cs @@ -32,6 +32,11 @@ get { return (Aspect)GetValue(AspectProperty); } set { SetValue(AspectProperty, value); } } + + public bool IsLoading { get; set; } + + public event EventHandler Success; + public event EventHandler Error; } #endif } diff --git a/src/Core/Controls/CipherViewCell/BaseCipherViewCell.cs b/src/Core/Controls/CipherViewCell/BaseCipherViewCell.cs index 15bd0dd7f..69fbd75f5 100644 --- a/src/Core/Controls/CipherViewCell/BaseCipherViewCell.cs +++ b/src/Core/Controls/CipherViewCell/BaseCipherViewCell.cs @@ -47,6 +47,7 @@ namespace Bit.App.Controls }); } +#if !UT public void Icon_Success(object sender, FFImageLoading.Maui.CachedImageEvents.SuccessEventArgs e) { if (BindingContext is CipherItemViewModel cipherItemVM) @@ -72,6 +73,10 @@ namespace Bit.App.Controls IconPlaceholder.IsVisible = true; }); } +#else + private void Icon_Success(object sender, EventArgs e) {} + private void Icon_Error(object sender, EventArgs e) {} +#endif } public class StubBaseCipherViewCellSoLinkerDoesntRemoveMethods : BaseCipherViewCell @@ -81,6 +86,7 @@ namespace Bit.App.Controls public static void CallThisSoLinkerDoesntRemoveMethods() { +#if !UT var stub = new StubBaseCipherViewCellSoLinkerDoesntRemoveMethods(); try @@ -98,6 +104,7 @@ namespace Bit.App.Controls catch (Exception) { } +#endif } } }