Skip to content

Commit 2c20fe0

Browse files
committed
Make some tests
1 parent 1e82e8b commit 2c20fe0

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

src/Controls/tests/TestCases.Shared.Tests/Tests/ImageUITests.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,15 @@ public void Source_FontImageSource()
3636
remote.TapStateButton();
3737
VerifyScreenshot("ImageUITests_Source_FontImageSource_FontAwesome");
3838
}
39+
40+
[Test]
41+
public async void IsAnimationPlaying()
42+
{
43+
var remote = GoToStateRemote();
44+
await Task.Delay(500); // make sure the gif is NOT playing
45+
VerifyScreenshot("ImageUITests_IsAnimationPlaying_No");
46+
47+
remote.TapStateButton();
48+
VerifyScreenshot("ImageUITests_IsAnimationPlaying_Yes");
49+
}
3950
}

src/Core/src/Platform/Android/ImageViewExtensions.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ public static void UpdateIsAnimationPlaying(this ImageView imageView, IImageSour
3030

3131
public static void UpdateIsAnimationPlaying(this Drawable? drawable, IImageSourcePart image)
3232
{
33-
var animatable = drawable.TryJavaCast<IAnimatable>();
33+
// Testing the tests...
34+
var animatable = drawable as IAnimatable;
35+
36+
// But this is what I will do:
37+
// var animatable = drawable.TryJavaCast<IAnimatable>();
3438
if (animatable is not null)
3539
{
3640
if (image.IsAnimationPlaying)

0 commit comments

Comments
 (0)