mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-06-30 02:31:08 +00:00
36 lines
1.1 KiB
C#
36 lines
1.1 KiB
C#
using System;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using CleanArchitecture.IntegrationTests.Fixtures.gRPC;
|
|
using CleanArchitecture.Proto.Tenants;
|
|
using FluentAssertions;
|
|
|
|
namespace CleanArchitecture.IntegrationTests.gRPC;
|
|
|
|
public sealed class GetTenantsByIdsTests
|
|
{
|
|
private readonly GetTenantsByIdsTestFixture _fixture = new();
|
|
|
|
[OneTimeSetUp]
|
|
public async Task Setup() => await _fixture.SeedTestData();
|
|
|
|
[Test]
|
|
public async Task Should_Get_Tenants_By_Ids()
|
|
{
|
|
var client = new TenantsApi.TenantsApiClient(_fixture.GrpcChannel);
|
|
|
|
var request = new GetTenantsByIdsRequest();
|
|
request.Ids.Add(_fixture.CreatedTenantId.ToString());
|
|
|
|
var response = await client.GetByIdsAsync(request);
|
|
|
|
response.Tenants.Should().HaveCount(1);
|
|
|
|
var tenant = response.Tenants.First();
|
|
var createdTenant = _fixture.CreateTenant();
|
|
|
|
new Guid(tenant.Id).Should().Be(createdTenant.Id);
|
|
tenant.Name.Should().Be(createdTenant.Name);
|
|
tenant.DeletedAt.Should().NotBeNullOrWhiteSpace();
|
|
}
|
|
} |