Skip to content

Commit

Permalink
Tightened constraints for testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick-Pimentel-Bitwarden committed Dec 16, 2024
1 parent 7687a16 commit 0562f76
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ SqlAuthRepo.AuthRequestRepository sqlAuthRequestRepository
}

[CiSkippedTheory, EfDeviceAutoData]
public async Task GetManyByUserIdWithDeviceAuth_WorksWithNoAuthRequest_ReturnsExpectedResults(
public async Task GetManyByUserIdWithDeviceAuth_WorksWithNoAuthRequestAndMultipleDevices_ReturnsExpectedResults(
Device device,
User user,
List<EfRepo.DeviceRepository> efSuts,
Expand Down Expand Up @@ -193,10 +193,14 @@ public async Task GetManyByUserIdWithDeviceAuth_WorksWithNoAuthRequest_ReturnsEx

// Create device
device.UserId = efUser.Id;

device.Identifier = Guid.NewGuid().ToString();
device.Name = "test-ef-chrome";
await efSuts[i].CreateAsync(device);

device.Identifier = Guid.NewGuid().ToString();
device.Name = "test-ef-chrome-2";
await efSuts[i].CreateAsync(device);
efSut.ClearChangeTracking();
}

// Dapper Repo
Expand All @@ -207,9 +211,15 @@ public async Task GetManyByUserIdWithDeviceAuth_WorksWithNoAuthRequest_ReturnsEx

// Create device
device.UserId = sqlUser.Id;

device.Identifier = Guid.NewGuid().ToString();
device.Name = "test-sql-chrome";
await sqlSut.CreateAsync(device);

device.Identifier = Guid.NewGuid().ToString();
device.Name = "test-ef-chrome-2";
await sqlSut.CreateAsync(device);

// Act

// Entity Framework Responses
Expand All @@ -230,6 +240,7 @@ public async Task GetManyByUserIdWithDeviceAuth_WorksWithNoAuthRequest_ReturnsEx
{
Assert.NotNull(response.First());
Assert.Null(response.First().DevicePendingAuthRequest);
Assert.True(response.Count == 2);
}
}

Expand Down Expand Up @@ -273,7 +284,7 @@ SqlAuthRepo.AuthRequestRepository sqlAuthRequestRepository
// Arrange
var allResponses = new List<ICollection<DeviceAuthRequestResponseModel>>();
var userIdsToSearchOn = new List<Guid>();
var expirationTime = 15;
const int expirationTime = 15;

// Configure data for successful responses.
user.Email = $"{user.Id.ToString().Substring(0, 5)}@test.com";
Expand Down

0 comments on commit 0562f76

Please sign in to comment.