Skip to content

Commit

Permalink
Additional test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed Nov 23, 2021
1 parent 9713f31 commit 61cc0ac
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/Core/tests/DeviceTests/Handlers/View/ViewHandlerTests.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using System.Threading.Tasks;
using Microsoft.Maui.DeviceTests.Stubs;
using Microsoft.Maui;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Handlers;
using Microsoft.Maui.Hosting;
using Microsoft.Maui;
using Xunit;

namespace Microsoft.Maui.DeviceTests
Expand Down Expand Up @@ -31,5 +32,29 @@ public async Task NativeArrangeTriggersMapFrame()

Assert.Equal(1, didUpdateFrame);
}

[Fact(DisplayName = "Subsequint NativeArrange triggers MapFrame")]
public async Task SubsequintNativeArrangeTriggersMapFrame()
{
var didUpdateFrame = 0;

var view = new StubBase();

await InvokeOnMainThreadAsync(() =>
{
var handler = new StubBaseHandler();
handler.CommandMapper.AppendToMapping(nameof(IView.Frame), (h, v, a) =>
{
didUpdateFrame++;
});
InitializeViewHandler(view, handler);
handler.NativeArrange(new Rectangle(0, 0, 100, 100));
});

Assert.Equal(2, didUpdateFrame);
}
}
}

0 comments on commit 61cc0ac

Please sign in to comment.