using System; using Moq; using Perspex.Platform; namespace Perspex.UnitTests { public class MockWindowingPlatform : IWindowingPlatform { private readonly Func _windowImpl; private readonly Func _popupImpl; public MockWindowingPlatform(Func windowImpl = null, Func popupImpl = null ) { _windowImpl = windowImpl; _popupImpl = popupImpl; } public IWindowImpl CreateWindow() { return _windowImpl?.Invoke() ?? Mock.Of(); } public IWindowImpl CreateEmbeddableWindow() { throw new NotImplementedException(); } public IPopupImpl CreatePopup() => _popupImpl?.Invoke() ?? Mock.Of(); } }