2022-11-18 16:13:32 +05:00
|
|
|
|
using AsbCloudDb.Model;
|
2022-09-05 09:13:45 +05:00
|
|
|
|
using AsbCloudInfrastructure.Services;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace AsbCloudWebApi.Tests.ServicesTests
|
|
|
|
|
{
|
|
|
|
|
public class FileCategoryServiceTest
|
|
|
|
|
{
|
|
|
|
|
private readonly AsbCloudDbContext context;
|
|
|
|
|
private FileCategoryService service;
|
|
|
|
|
|
|
|
|
|
public FileCategoryServiceTest()
|
|
|
|
|
{
|
|
|
|
|
|
2022-11-15 17:44:48 +05:00
|
|
|
|
context = TestHelpter.MakeRealTestContext();
|
2022-09-05 09:13:45 +05:00
|
|
|
|
context.SaveChanges();
|
2022-11-18 16:13:32 +05:00
|
|
|
|
service = new FileCategoryService(context, TestHelpter.MemoryCache);
|
2022-09-05 09:13:45 +05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
~FileCategoryServiceTest()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public async Task GetWellCategoryAsync_return_cnt_file_category()
|
|
|
|
|
{
|
2022-09-13 11:47:12 +05:00
|
|
|
|
var cnt = (await service.GetWellCaseCategoriesAsync(CancellationToken.None)).Count();
|
2022-09-05 09:13:45 +05:00
|
|
|
|
Assert.NotEqual(0, cnt);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|