2026-01-28 19:32:11 +08:00
|
|
|
|
namespace WebApi.Test.Repository;
|
2026-01-28 17:00:58 +08:00
|
|
|
|
|
|
|
|
|
|
public class PushSubscriptionRepositoryTest : RepositoryTestBase
|
|
|
|
|
|
{
|
|
|
|
|
|
private readonly IPushSubscriptionRepository _repository;
|
|
|
|
|
|
|
|
|
|
|
|
public PushSubscriptionRepositoryTest()
|
|
|
|
|
|
{
|
|
|
|
|
|
_repository = new PushSubscriptionRepository(FreeSql);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
|
public async Task GetByEndpointAsync_通过Endpoint获取_Test()
|
|
|
|
|
|
{
|
|
|
|
|
|
await _repository.AddAsync(new PushSubscription { Endpoint = "ep1" });
|
2026-01-30 10:41:19 +08:00
|
|
|
|
|
2026-01-28 17:00:58 +08:00
|
|
|
|
var sub = await _repository.GetByEndpointAsync("ep1");
|
|
|
|
|
|
sub.Should().NotBeNull();
|
2026-01-28 19:32:11 +08:00
|
|
|
|
sub.Endpoint.Should().Be("ep1");
|
2026-01-28 17:00:58 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|