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.
abp/modules/docs/test/Volo.Docs.Application.Tests/Volo/Docs/ApplicationService_Tests.cs

46 lines
1.3 KiB

using System.Threading.Tasks;
using Shouldly;
using Volo.Docs.Projects;
using Xunit;
namespace Volo.Docs
{
public class ApplicationService_Tests : DocsApplicationTestBase
{
private readonly IProjectAppService _projectAppService;
private readonly DocsTestData _testData;
public ApplicationService_Tests()
{
_projectAppService = GetRequiredService<IProjectAppService>();
_testData = GetRequiredService<DocsTestData>();
}
[Fact]
public async Task GetListAsync()
{
var projects = await _projectAppService.GetListAsync();
projects.ShouldNotBeNull();
projects.Items.Count.ShouldBe(1);
projects.Items.ShouldContain(x => x.Id == _testData.PorjectId);
}
[Fact]
public async Task GetAsync()
{
var project = await _projectAppService.GetAsync("ABP");
project.ShouldNotBeNull();
project.ShortName.ShouldBe("ABP");
}
[Fact]
public async Task GetVersionsAsync()
{
var versions = await _projectAppService.GetVersionsAsync("ABP");
versions.ShouldNotBeNull();
versions.Items.Count.ShouldBe(1);
versions.Items.ShouldContain(x => x.Name == "0.15.0" && x.DisplayName == "0.15.0");
}
}
}