mirror of https://github.com/abpframework/abp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
2.0 KiB
56 lines
2.0 KiB
using System.Threading.Tasks;
|
|
using Shouldly;
|
|
using Volo.Docs.Admin.Documents;
|
|
using Volo.Docs.Documents;
|
|
using Xunit;
|
|
|
|
namespace Volo.Docs
|
|
{
|
|
public class DocumentAdminAppService_Tests : DocsAdminApplicationTestBase
|
|
{
|
|
private readonly IDocumentAdminAppService _documentAdminAppService;
|
|
private readonly IDocumentRepository _documentRepository;
|
|
private readonly DocsTestData _testData;
|
|
|
|
public DocumentAdminAppService_Tests()
|
|
{
|
|
_documentAdminAppService = GetRequiredService<IDocumentAdminAppService>();
|
|
_documentRepository = GetRequiredService<IDocumentRepository>();
|
|
_testData = GetRequiredService<DocsTestData>();
|
|
}
|
|
|
|
[Fact]
|
|
public async Task PullAsync()
|
|
{
|
|
(await _documentRepository.FindAsync(_testData.PorjectId, "Part-I.md", "en", "1.0.0")).ShouldBeNull();
|
|
|
|
await _documentAdminAppService.PullAsync(new PullDocumentInput
|
|
{
|
|
ProjectId = _testData.PorjectId,
|
|
Name = "Part-I.md",
|
|
LanguageCode = "en",
|
|
Version = "1.0.0"
|
|
});
|
|
|
|
(await _documentRepository.FindAsync(_testData.PorjectId, "Part-I.md", "en", "1.0.0")).ShouldNotBeNull();
|
|
}
|
|
|
|
[Fact]
|
|
public async Task PullAllAsync()
|
|
{
|
|
(await _documentRepository.FindAsync(_testData.PorjectId, "Part-I.md", "en", "1.0.0")).ShouldBeNull();
|
|
(await _documentRepository.FindAsync(_testData.PorjectId, "Part-II.md", "en", "1.0.0")).ShouldBeNull();
|
|
|
|
await _documentAdminAppService.PullAllAsync(new PullAllDocumentInput
|
|
{
|
|
ProjectId = _testData.PorjectId,
|
|
LanguageCode = "en",
|
|
Version = "1.0.0"
|
|
});
|
|
|
|
(await _documentRepository.FindAsync(_testData.PorjectId, "Part-I.md", "en", "1.0.0")).ShouldNotBeNull();
|
|
(await _documentRepository.FindAsync(_testData.PorjectId, "Part-II.md", "en", "1.0.0")).ShouldNotBeNull();
|
|
}
|
|
}
|
|
}
|