24 lines
584 B
C#
24 lines
584 B
C#
|
|
using FluentAssertions;
|
|||
|
|
|
|||
|
|
namespace WebApi.Test.Repository;
|
|||
|
|
|
|||
|
|
public class ConfigRepositoryTest : RepositoryTestBase
|
|||
|
|
{
|
|||
|
|
private readonly IConfigRepository _repository;
|
|||
|
|
|
|||
|
|
public ConfigRepositoryTest()
|
|||
|
|
{
|
|||
|
|
_repository = new ConfigRepository(FreeSql);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[Fact]
|
|||
|
|
public async Task GetByKeyAsync_获取配置_Test()
|
|||
|
|
{
|
|||
|
|
await _repository.AddAsync(new ConfigEntity { Key = "k1", Value = "v1" });
|
|||
|
|
|
|||
|
|
var config = await _repository.GetByKeyAsync("k1");
|
|||
|
|
config.Should().NotBeNull();
|
|||
|
|
config!.Value.Should().Be("v1");
|
|||
|
|
}
|
|||
|
|
}
|