ant-design-blazor/tests/AntDesign.TestKit/TestDomEventService.cs
Andrzej Bakun 5c2f48f718 fix(module: select): arrow down click does not auto close (#1977)
* fix(module:select): arrow down click does not auto close

* test case added
2021-10-11 22:17:14 +08:00

33 lines
980 B
C#

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AntDesign.JsInterop;
using Microsoft.JSInterop;
using Moq;
namespace AntDesign.Tests
{
public class TestDomEventService : AntDesign.JsInterop.DomEventService
{
public Mock<IDomEventListener> MockedDomEventListener { get; set; }
public TestDomEventService(IJSRuntime js, Mock<IDomEventListener> mock = null) : base(js)
{
if (mock is not null)
{
MockedDomEventListener = mock;
}
}
public override IDomEventListener CreateDomEventListerner()
{
return MockedDomEventListener?.Object ?? new TestDomEventListerner();
}
}
}