implement GetTransferDrivers to AdminSignalRClient; Add GetTransferDiversByTransferIdAsyncTest_ReturnDrivers_WhenHasDrivers test method;
This commit is contained in:
parent
bd42d4fd51
commit
3566aaca63
|
|
@ -2,8 +2,8 @@
|
|||
"ConnectionStrings": {
|
||||
//"DeveloperDbConnection": "Data Source=185.51.190.197;Initial Catalog=TIAM_DEV;Trusted_Connection=false;Encrypt=false;TrustServerCertificate=True;Connect Timeout=200;User ID=Anata_Development_Team;Password=v6f_?xNfg9N1;MultipleActiveResultSets=true"
|
||||
|
||||
//"DeveloperDbConnection": "Data Source=194.164.235.47;Initial Catalog=TIAM_DEV;Trusted_Connection=false;Encrypt=false;TrustServerCertificate=True;Connect Timeout=200;User ID=Anata_Development_Team;Password=v6f_?xNfg9N1;MultipleActiveResultSets=true"
|
||||
"DeveloperDbConnection": "Data Source=194.164.235.47;Initial Catalog=TIAM_DEVRELEASE;Trusted_Connection=false;Encrypt=false;TrustServerCertificate=True;Connect Timeout=200;User ID=Anata_Development_Team;Password=v6f_?xNfg9N1;MultipleActiveResultSets=true"
|
||||
"DeveloperDbConnection": "Data Source=194.164.235.47;Initial Catalog=TIAM_DEV;Trusted_Connection=false;Encrypt=false;TrustServerCertificate=True;Connect Timeout=200;User ID=Anata_Development_Team;Password=v6f_?xNfg9N1;MultipleActiveResultSets=true"
|
||||
//"DeveloperDbConnection": "Data Source=194.164.235.47;Initial Catalog=TIAM_DEVRELEASE;Trusted_Connection=false;Encrypt=false;TrustServerCertificate=True;Connect Timeout=200;User ID=Anata_Development_Team;Password=v6f_?xNfg9N1;MultipleActiveResultSets=true"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
|
|
|
|||
|
|
@ -107,9 +107,8 @@ namespace TIAMWebApp.Shared.Application.Services
|
|||
}
|
||||
|
||||
public async Task<List<TransferToDriver>> GetTransferDrivers(Guid transferId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
=> await GetByIdAsync<List<TransferToDriver>>(SignalRTags.GetTransferDriversByTransferId, transferId) ?? [];
|
||||
|
||||
|
||||
public async Task<TransferToDriver?> AddTransferDriver(TransferToDriver transferToDriver)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -306,5 +306,20 @@ namespace Tiam.Services.Client.Tests
|
|||
Assert.IsTrue(cars.All(car => drivers.Any(driver => driver.Id == car.UserProductMappingId && driver.ProductId == productId)));
|
||||
Assert.IsTrue(drivers.All(driver => driver.ProductId == productId && cars.Any(car => car.UserProductMappingId == driver.Id)));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[DataRow("ddf26c38-933e-45aa-ad1f-76f6affc9fd1")]
|
||||
public async Task GetTransferDiversByTransferIdAsyncTest_ReturnDrivers_WhenHasDrivers(string transferIdString)
|
||||
{
|
||||
var transferId = Guid.Parse(transferIdString);
|
||||
|
||||
//var drivers = await _signalRClient.GetByIdAsync<List<TransferToDriver>>(SignalRTags.GetTransferDriversByTransferId, transferId);
|
||||
var drivers = await _signalRClient.GetTransferDrivers(transferId);
|
||||
|
||||
await TaskHelper.WaitToAsync(() => drivers.Count > 0, 5000, 50);
|
||||
|
||||
Assert.IsTrue(drivers.Count > 0);
|
||||
Assert.IsTrue(drivers.All(driver => driver.TransferId == transferId));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue