123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using OrBit.MESInterface.Domain.InterfaceConfiguration.Entities;
- using OrBit.MESInterface.Domain.InterfaceConfiguration.Repository;
- using Shouldly;
- using System.Linq;
- using System.Threading.Tasks;
- using Volo.Abp.Domain.Repositories;
- using Xunit;
- namespace OrBit.MESInterface.EntityFrameworkCore.Tests.UnitTests
- {
- public class InterfaceRequestConfigurationRepositoryTests : MESInterfaceEntityFrameworkCoreTestBase
- {
- private readonly IInterface_Request_ConfigurationRepository _interface_Request_ConfigurationRepository;
- private readonly IRepository<Interface_Post_ServiceCode> _interface_Post_ServiceCodeRepository;
- private readonly IRepository<Interface_RequestHeader> _interface_RequestHeader;
- public InterfaceRequestConfigurationRepositoryTests()
- {
- _interface_Request_ConfigurationRepository = GetRequiredService<IInterface_Request_ConfigurationRepository>();
- _interface_Post_ServiceCodeRepository = GetRequiredService<IRepository<Interface_Post_ServiceCode>>();
- _interface_RequestHeader = GetRequiredService<IRepository<Interface_RequestHeader>>();
- }
- [Fact]
- public async Task Should_Get_List_Of_InterfaceRequestConfigurations()
- {
- var result = await WithUnitOfWorkAsync(async () =>
- await _interface_Request_ConfigurationRepository.GetListAsync());
- result.Count.ShouldBe(1);
- }
- [Fact]
- public async Task Should_GetList_of_Interface_Post_ServiceCode()
- {
- var result = await WithUnitOfWorkAsync(async () =>
- await _interface_Post_ServiceCodeRepository.GetListAsync()
- );
- result.Count.ShouldBeGreaterThan(0);
- }
- [Fact]
- public async Task Should_GetList_of_Interface_RequestHeader()
- {
- var result = await WithUnitOfWorkAsync(async () => await _interface_RequestHeader.GetListAsync());
- result.Count.ShouldBeGreaterThan(0);
- }
- [Fact]
- public async Task Should_GetDetailsList_of_InterfaceRequestConfigurations()
- {
- var result = await WithUnitOfWorkAsync(async () => await _interface_Request_ConfigurationRepository
- .GetAsync(config => config.InterfaceType == "SAPDataDownload", true
- ));
- result.ShouldNotBeNull();
- result._Post_ServiceCodes.ToList().Count.ShouldBeGreaterThan(0);
- // result[0]._RequestParameters.ToList().Count.ShouldBeGreaterThan(0);
- result._RequestHeaders.ToList().Count.ShouldBeGreaterThan(0);
- }
- }
- }
|