namespace WebApi.Test.Repository;

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" });
        
        var sub = await _repository.GetByEndpointAsync("ep1");
        sub.Should().NotBeNull();
        sub.Endpoint.Should().Be("ep1");
    }
}
