1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-06-28 10:54:59 +02:00

PM-3349 PM-3350 Fixed Unit tests because of referencing FFImageLoading when it's not possible

This commit is contained in:
Federico Maccaroni 2024-02-08 12:31:52 -03:00
parent 51ee6a84b5
commit 4631a9e62c
No known key found for this signature in database
GPG Key ID: 5D233F8F2B034536
2 changed files with 12 additions and 0 deletions

View File

@ -32,6 +32,11 @@
get { return (Aspect)GetValue(AspectProperty); } get { return (Aspect)GetValue(AspectProperty); }
set { SetValue(AspectProperty, value); } set { SetValue(AspectProperty, value); }
} }
public bool IsLoading { get; set; }
public event EventHandler Success;
public event EventHandler Error;
} }
#endif #endif
} }

View File

@ -47,6 +47,7 @@ namespace Bit.App.Controls
}); });
} }
#if !UT
public void Icon_Success(object sender, FFImageLoading.Maui.CachedImageEvents.SuccessEventArgs e) public void Icon_Success(object sender, FFImageLoading.Maui.CachedImageEvents.SuccessEventArgs e)
{ {
if (BindingContext is CipherItemViewModel cipherItemVM) if (BindingContext is CipherItemViewModel cipherItemVM)
@ -72,6 +73,10 @@ namespace Bit.App.Controls
IconPlaceholder.IsVisible = true; 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 public class StubBaseCipherViewCellSoLinkerDoesntRemoveMethods : BaseCipherViewCell
@ -81,6 +86,7 @@ namespace Bit.App.Controls
public static void CallThisSoLinkerDoesntRemoveMethods() public static void CallThisSoLinkerDoesntRemoveMethods()
{ {
#if !UT
var stub = new StubBaseCipherViewCellSoLinkerDoesntRemoveMethods(); var stub = new StubBaseCipherViewCellSoLinkerDoesntRemoveMethods();
try try
@ -98,6 +104,7 @@ namespace Bit.App.Controls
catch (Exception) catch (Exception)
{ {
} }
#endif
} }
} }
} }