Skip to content

Commit

Permalink
Make some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed Jun 6, 2024
1 parent 1e82e8b commit 2c20fe0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/Controls/tests/TestCases.Shared.Tests/Tests/ImageUITests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,15 @@ public void Source_FontImageSource()
remote.TapStateButton();
VerifyScreenshot("ImageUITests_Source_FontImageSource_FontAwesome");
}

[Test]
public async void IsAnimationPlaying()
{
var remote = GoToStateRemote();
await Task.Delay(500); // make sure the gif is NOT playing
VerifyScreenshot("ImageUITests_IsAnimationPlaying_No");

remote.TapStateButton();
VerifyScreenshot("ImageUITests_IsAnimationPlaying_Yes");
}
}
6 changes: 5 additions & 1 deletion src/Core/src/Platform/Android/ImageViewExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ public static void UpdateIsAnimationPlaying(this ImageView imageView, IImageSour

public static void UpdateIsAnimationPlaying(this Drawable? drawable, IImageSourcePart image)
{
var animatable = drawable.TryJavaCast<IAnimatable>();
// Testing the tests...
var animatable = drawable as IAnimatable;

// But this is what I will do:
// var animatable = drawable.TryJavaCast<IAnimatable>();
if (animatable is not null)
{
if (image.IsAnimationPlaying)
Expand Down

0 comments on commit 2c20fe0

Please sign in to comment.