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 d29e69d
Showing 1 changed file with 13 additions and 2 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

0 comments on commit d29e69d

Please sign in to comment.