teamlead-dashboard/tests/TUI.Engine.Tests/MockExtensions.cs

18 lines
528 B
C#

using Moq;
using TUI.Engine.Nodes;
using TUI.Engine.Rendering.Canvas;
namespace TUI.Engine.Tests;
public static class MockExtensions
{
public static void VerifyPositionOnce<T>(this Mock<T> mock, int left, int top) where T : class, ICanvas
{
mock.Verify(w => w.SetPencil(new Position(left, top)), Times.Exactly(1));
}
public static void VerifyPositionOnce<T>(this Mock<T> mock, Position position) where T : class, ICanvas
{
mock.Verify(w => w.SetPencil(position), Times.Exactly(1));
}
}