1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-21 12:05:42 +01:00

Replace async void with async Task (#3835)

This commit is contained in:
Justin Baur 2024-02-22 10:59:08 -06:00 committed by GitHub
parent 1499d1e2c6
commit e22da3a53e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
28 changed files with 211 additions and 211 deletions

View File

@ -109,7 +109,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void GetProjectAccessPolicies_ReturnsEmptyList( public async Task GetProjectAccessPolicies_ReturnsEmptyList(
PermissionType permissionType, PermissionType permissionType,
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Project data) Guid id, Project data)
@ -144,7 +144,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetProjectAccessPolicies_UserWithoutPermission_Throws( public async Task GetProjectAccessPolicies_UserWithoutPermission_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
Project data) Project data)
@ -163,7 +163,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void GetProjectAccessPolicies_Success( public async Task GetProjectAccessPolicies_Success(
PermissionType permissionType, PermissionType permissionType,
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
@ -202,7 +202,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetProjectAccessPolicies_ProjectsExist_UserWithoutPermission_Throws( public async Task GetProjectAccessPolicies_ProjectsExist_UserWithoutPermission_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
Project data, Project data,
@ -225,7 +225,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void GetServiceAccountGrantedPolicies_ReturnsEmptyList( public async Task GetServiceAccountGrantedPolicies_ReturnsEmptyList(
PermissionType permissionType, PermissionType permissionType,
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, ServiceAccount data) Guid id, ServiceAccount data)
@ -257,7 +257,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void GetServiceAccountGrantedPolicies_Success( public async Task GetServiceAccountGrantedPolicies_Success(
PermissionType permissionType, PermissionType permissionType,
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
@ -289,7 +289,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void CreateProjectAccessPolicies_RequestMoreThanMax_Throws( public async Task CreateProjectAccessPolicies_RequestMoreThanMax_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
Project mockProject, Project mockProject,
@ -311,7 +311,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void CreateProjectAccessPolicies_ProjectDoesNotExist_Throws( public async Task CreateProjectAccessPolicies_ProjectDoesNotExist_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
AccessPoliciesCreateRequest request) AccessPoliciesCreateRequest request)
@ -325,7 +325,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void CreateProjectAccessPolicies_DuplicatePolicy_Throws( public async Task CreateProjectAccessPolicies_DuplicatePolicy_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
Project mockProject, Project mockProject,
@ -348,7 +348,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void CreateProjectAccessPolicies_NoAccess_Throws( public async Task CreateProjectAccessPolicies_NoAccess_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
Project mockProject, Project mockProject,
@ -377,7 +377,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void CreateProjectAccessPolicies_Success( public async Task CreateProjectAccessPolicies_Success(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
Project mockProject, Project mockProject,
@ -405,7 +405,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void CreateServiceAccountGrantedPolicies_RequestMoreThanMax_Throws( public async Task CreateServiceAccountGrantedPolicies_RequestMoreThanMax_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
ServiceAccount serviceAccount, ServiceAccount serviceAccount,
@ -428,7 +428,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void CreateServiceAccountGrantedPolicies_ServiceAccountDoesNotExist_Throws( public async Task CreateServiceAccountGrantedPolicies_ServiceAccountDoesNotExist_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
List<GrantedAccessPolicyRequest> request) List<GrantedAccessPolicyRequest> request)
@ -442,7 +442,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void CreateServiceAccountGrantedPolicies_DuplicatePolicy_Throws( public async Task CreateServiceAccountGrantedPolicies_DuplicatePolicy_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
ServiceAccount serviceAccount, ServiceAccount serviceAccount,
@ -467,7 +467,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void CreateServiceAccountGrantedPolicies_NoAccess_Throws( public async Task CreateServiceAccountGrantedPolicies_NoAccess_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
ServiceAccount serviceAccount, ServiceAccount serviceAccount,
@ -494,7 +494,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void CreateServiceAccountGrantedPolicies_Success( public async Task CreateServiceAccountGrantedPolicies_Success(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
ServiceAccount serviceAccount, ServiceAccount serviceAccount,
@ -520,7 +520,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void UpdateAccessPolicies_NoAccess_Throws( public async Task UpdateAccessPolicies_NoAccess_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
UserProjectAccessPolicy data, UserProjectAccessPolicy data,
@ -542,7 +542,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void UpdateAccessPolicies_Success( public async Task UpdateAccessPolicies_Success(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
UserProjectAccessPolicy data, UserProjectAccessPolicy data,
@ -563,7 +563,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void DeleteAccessPolicies_NoAccess_Throws(SutProvider<AccessPoliciesController> sutProvider, Guid id) public async Task DeleteAccessPolicies_NoAccess_Throws(SutProvider<AccessPoliciesController> sutProvider, Guid id)
{ {
sutProvider.GetDependency<IAuthorizationService>() sutProvider.GetDependency<IAuthorizationService>()
.AuthorizeAsync(Arg.Any<ClaimsPrincipal>(), new UserProjectAccessPolicy(), .AuthorizeAsync(Arg.Any<ClaimsPrincipal>(), new UserProjectAccessPolicy(),
@ -579,7 +579,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void DeleteAccessPolicies_Success(SutProvider<AccessPoliciesController> sutProvider, Guid id) public async Task DeleteAccessPolicies_Success(SutProvider<AccessPoliciesController> sutProvider, Guid id)
{ {
sutProvider.GetDependency<IAuthorizationService>() sutProvider.GetDependency<IAuthorizationService>()
.AuthorizeAsync(Arg.Any<ClaimsPrincipal>(), new UserProjectAccessPolicy(), .AuthorizeAsync(Arg.Any<ClaimsPrincipal>(), new UserProjectAccessPolicy(),
@ -595,7 +595,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void GetPeoplePotentialGrantees_ReturnsEmptyList( public async Task GetPeoplePotentialGrantees_ReturnsEmptyList(
PermissionType permissionType, PermissionType permissionType,
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id) Guid id)
@ -617,7 +617,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetPeoplePotentialGrantees_UserWithoutPermission_Throws( public async Task GetPeoplePotentialGrantees_UserWithoutPermission_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id) Guid id)
{ {
@ -640,7 +640,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void GetPeoplePotentialGrantees_Success( public async Task GetPeoplePotentialGrantees_Success(
PermissionType permissionType, PermissionType permissionType,
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
@ -665,7 +665,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void GetServiceAccountsPotentialGrantees_ReturnsEmptyList( public async Task GetServiceAccountsPotentialGrantees_ReturnsEmptyList(
PermissionType permissionType, PermissionType permissionType,
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id) Guid id)
@ -683,7 +683,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetServiceAccountsPotentialGranteesAsync_UserWithoutPermission_Throws( public async Task GetServiceAccountsPotentialGranteesAsync_UserWithoutPermission_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id) Guid id)
{ {
@ -700,7 +700,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void GetServiceAccountsPotentialGranteesAsync_Success( public async Task GetServiceAccountsPotentialGranteesAsync_Success(
PermissionType permissionType, PermissionType permissionType,
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
@ -724,7 +724,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void GetProjectPotentialGrantees_ReturnsEmptyList( public async Task GetProjectPotentialGrantees_ReturnsEmptyList(
PermissionType permissionType, PermissionType permissionType,
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id) Guid id)
@ -742,7 +742,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetProjectPotentialGrantees_UserWithoutPermission_Throws( public async Task GetProjectPotentialGrantees_UserWithoutPermission_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id) Guid id)
{ {
@ -759,7 +759,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void GetProjectPotentialGrantees_Success( public async Task GetProjectPotentialGrantees_Success(
PermissionType permissionType, PermissionType permissionType,
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
@ -783,7 +783,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void GetProjectPeopleAccessPolicies_ReturnsEmptyList( public async Task GetProjectPeopleAccessPolicies_ReturnsEmptyList(
PermissionType permissionType, PermissionType permissionType,
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Project data) Guid id, Project data)
@ -817,7 +817,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetProjectPeopleAccessPolicies_UserWithoutPermission_Throws( public async Task GetProjectPeopleAccessPolicies_UserWithoutPermission_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
Project data) Project data)
@ -835,7 +835,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetProjectPeopleAccessPolicies_ProjectsExist_UserWithoutPermission_Throws( public async Task GetProjectPeopleAccessPolicies_ProjectsExist_UserWithoutPermission_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
Project data, Project data,
@ -858,7 +858,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void GetProjectPeopleAccessPolicies_Success( public async Task GetProjectPeopleAccessPolicies_Success(
PermissionType permissionType, PermissionType permissionType,
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
@ -897,7 +897,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void PutProjectPeopleAccessPolicies_ProjectDoesNotExist_Throws( public async Task PutProjectPeopleAccessPolicies_ProjectDoesNotExist_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid id, Guid id,
PeopleAccessPoliciesRequestModel request) PeopleAccessPoliciesRequestModel request)
@ -911,7 +911,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void PutProjectPeopleAccessPoliciesAsync_DuplicatePolicy_Throws( public async Task PutProjectPeopleAccessPoliciesAsync_DuplicatePolicy_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Project project, Project project,
PeopleAccessPoliciesRequestModel request) PeopleAccessPoliciesRequestModel request)
@ -929,7 +929,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void PutProjectPeopleAccessPoliciesAsync_NoAccess_Throws( public async Task PutProjectPeopleAccessPoliciesAsync_NoAccess_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Project project, Project project,
PeopleAccessPoliciesRequestModel request) PeopleAccessPoliciesRequestModel request)
@ -949,7 +949,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void PutProjectPeopleAccessPoliciesAsync_Success( public async Task PutProjectPeopleAccessPoliciesAsync_Success(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
Guid userId, Guid userId,
Project project, Project project,
@ -973,7 +973,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetServiceAccountPeopleAccessPoliciesAsync_ServiceAccountDoesntExist_ThrowsNotFound( public async Task GetServiceAccountPeopleAccessPoliciesAsync_ServiceAccountDoesntExist_ThrowsNotFound(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
ServiceAccount data) ServiceAccount data)
{ {
@ -989,7 +989,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void GetServiceAccountPeopleAccessPoliciesAsync_ReturnsEmptyList( public async Task GetServiceAccountPeopleAccessPoliciesAsync_ReturnsEmptyList(
PermissionType permissionType, PermissionType permissionType,
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
ServiceAccount data) ServiceAccount data)
@ -1020,7 +1020,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetServiceAccountPeopleAccessPoliciesAsync_UserWithoutPermission_Throws( public async Task GetServiceAccountPeopleAccessPoliciesAsync_UserWithoutPermission_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
ServiceAccount data) ServiceAccount data)
{ {
@ -1039,7 +1039,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void GetServiceAccountPeopleAccessPoliciesAsync_Success( public async Task GetServiceAccountPeopleAccessPoliciesAsync_Success(
PermissionType permissionType, PermissionType permissionType,
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
ServiceAccount data, ServiceAccount data,
@ -1073,7 +1073,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void PutServiceAccountPeopleAccessPolicies_ServiceAccountDoesNotExist_Throws( public async Task PutServiceAccountPeopleAccessPolicies_ServiceAccountDoesNotExist_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
ServiceAccount data, ServiceAccount data,
PeopleAccessPoliciesRequestModel request) PeopleAccessPoliciesRequestModel request)
@ -1087,7 +1087,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void PutServiceAccountPeopleAccessPolicies_DuplicatePolicy_Throws( public async Task PutServiceAccountPeopleAccessPolicies_DuplicatePolicy_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
ServiceAccount data, ServiceAccount data,
PeopleAccessPoliciesRequestModel request) PeopleAccessPoliciesRequestModel request)
@ -1105,7 +1105,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void PutServiceAccountPeopleAccessPolicies_NotCanReadWrite_Throws( public async Task PutServiceAccountPeopleAccessPolicies_NotCanReadWrite_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
ServiceAccount data, ServiceAccount data,
PeopleAccessPoliciesRequestModel request) PeopleAccessPoliciesRequestModel request)
@ -1122,7 +1122,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void PutServiceAccountPeopleAccessPolicies_NoAccess_Throws( public async Task PutServiceAccountPeopleAccessPolicies_NoAccess_Throws(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
ServiceAccount data, ServiceAccount data,
PeopleAccessPoliciesRequestModel request) PeopleAccessPoliciesRequestModel request)
@ -1143,7 +1143,7 @@ public class AccessPoliciesControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void PutServiceAccountPeopleAccessPolicies_Success( public async Task PutServiceAccountPeopleAccessPolicies_Success(
SutProvider<AccessPoliciesController> sutProvider, SutProvider<AccessPoliciesController> sutProvider,
ServiceAccount data, ServiceAccount data,
Guid userId, Guid userId,

View File

@ -44,7 +44,7 @@ public class ProjectsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void ListByOrganization_SmAccessDenied_Throws(SutProvider<ProjectsController> sutProvider, Guid data) public async Task ListByOrganization_SmAccessDenied_Throws(SutProvider<ProjectsController> sutProvider, Guid data)
{ {
sutProvider.GetDependency<ICurrentContext>().AccessSecretsManager(data).Returns(false); sutProvider.GetDependency<ICurrentContext>().AccessSecretsManager(data).Returns(false);
@ -54,7 +54,7 @@ public class ProjectsControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void ListByOrganization_ReturnsEmptyList(PermissionType permissionType, public async Task ListByOrganization_ReturnsEmptyList(PermissionType permissionType,
SutProvider<ProjectsController> sutProvider, Guid data) SutProvider<ProjectsController> sutProvider, Guid data)
{ {
switch (permissionType) switch (permissionType)
@ -78,7 +78,7 @@ public class ProjectsControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void ListByOrganization_Success(PermissionType permissionType, public async Task ListByOrganization_Success(PermissionType permissionType,
SutProvider<ProjectsController> sutProvider, Guid data, Project mockProject) SutProvider<ProjectsController> sutProvider, Guid data, Project mockProject)
{ {
switch (permissionType) switch (permissionType)
@ -105,7 +105,7 @@ public class ProjectsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void Create_NoAccess_Throws(SutProvider<ProjectsController> sutProvider, public async Task Create_NoAccess_Throws(SutProvider<ProjectsController> sutProvider,
Guid orgId, ProjectCreateRequestModel data) Guid orgId, ProjectCreateRequestModel data)
{ {
sutProvider.GetDependency<IAuthorizationService>() sutProvider.GetDependency<IAuthorizationService>()
@ -125,7 +125,7 @@ public class ProjectsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void Create_AtMaxProjects_Throws(SutProvider<ProjectsController> sutProvider, public async Task Create_AtMaxProjects_Throws(SutProvider<ProjectsController> sutProvider,
Guid orgId, ProjectCreateRequestModel data) Guid orgId, ProjectCreateRequestModel data)
{ {
sutProvider.GetDependency<IAuthorizationService>() sutProvider.GetDependency<IAuthorizationService>()
@ -143,7 +143,7 @@ public class ProjectsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void Create_Success(SutProvider<ProjectsController> sutProvider, public async Task Create_Success(SutProvider<ProjectsController> sutProvider,
Guid orgId, ProjectCreateRequestModel data) Guid orgId, ProjectCreateRequestModel data)
{ {
sutProvider.GetDependency<IAuthorizationService>() sutProvider.GetDependency<IAuthorizationService>()
@ -164,7 +164,7 @@ public class ProjectsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void Update_NoAccess_Throws(SutProvider<ProjectsController> sutProvider, public async Task Update_NoAccess_Throws(SutProvider<ProjectsController> sutProvider,
Guid userId, ProjectUpdateRequestModel data, Project existingProject) Guid userId, ProjectUpdateRequestModel data, Project existingProject)
{ {
sutProvider.GetDependency<IAuthorizationService>() sutProvider.GetDependency<IAuthorizationService>()
@ -184,7 +184,7 @@ public class ProjectsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void Update_Success(SutProvider<ProjectsController> sutProvider, public async Task Update_Success(SutProvider<ProjectsController> sutProvider,
Guid userId, ProjectUpdateRequestModel data, Project existingProject) Guid userId, ProjectUpdateRequestModel data, Project existingProject)
{ {
sutProvider.GetDependency<IAuthorizationService>() sutProvider.GetDependency<IAuthorizationService>()
@ -205,7 +205,7 @@ public class ProjectsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void Get_SmAccessDenied_Throws(SutProvider<ProjectsController> sutProvider, Guid data, Guid orgId) public async Task Get_SmAccessDenied_Throws(SutProvider<ProjectsController> sutProvider, Guid data, Guid orgId)
{ {
SetupAdmin(sutProvider, orgId); SetupAdmin(sutProvider, orgId);
sutProvider.GetDependency<ICurrentContext>().AccessSecretsManager(orgId).Returns(false); sutProvider.GetDependency<ICurrentContext>().AccessSecretsManager(orgId).Returns(false);
@ -214,7 +214,7 @@ public class ProjectsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void Get_ThrowsNotFound(SutProvider<ProjectsController> sutProvider, Guid data, Guid orgId) public async Task Get_ThrowsNotFound(SutProvider<ProjectsController> sutProvider, Guid data, Guid orgId)
{ {
SetupAdmin(sutProvider, orgId); SetupAdmin(sutProvider, orgId);
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.GetAsync(data)); await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.GetAsync(data));
@ -223,7 +223,7 @@ public class ProjectsControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void Get_Success(PermissionType permissionType, SutProvider<ProjectsController> sutProvider, public async Task Get_Success(PermissionType permissionType, SutProvider<ProjectsController> sutProvider,
Guid orgId, Guid data) Guid orgId, Guid data)
{ {
switch (permissionType) switch (permissionType)
@ -252,7 +252,7 @@ public class ProjectsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void Get_UserWithoutPermission_Throws(SutProvider<ProjectsController> sutProvider, Guid orgId, public async Task Get_UserWithoutPermission_Throws(SutProvider<ProjectsController> sutProvider, Guid orgId,
Guid data) Guid data)
{ {
SetupUserWithPermission(sutProvider, orgId); SetupUserWithPermission(sutProvider, orgId);
@ -267,7 +267,7 @@ public class ProjectsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void BulkDeleteProjects_NoProjectsFound_ThrowsNotFound( public async Task BulkDeleteProjects_NoProjectsFound_ThrowsNotFound(
SutProvider<ProjectsController> sutProvider, List<Project> data) SutProvider<ProjectsController> sutProvider, List<Project> data)
{ {
var ids = data.Select(project => project.Id).ToList(); var ids = data.Select(project => project.Id).ToList();
@ -277,7 +277,7 @@ public class ProjectsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void BulkDeleteProjects_ProjectsFoundMisMatch_ThrowsNotFound( public async Task BulkDeleteProjects_ProjectsFoundMisMatch_ThrowsNotFound(
SutProvider<ProjectsController> sutProvider, List<Project> data, Project mockProject) SutProvider<ProjectsController> sutProvider, List<Project> data, Project mockProject)
{ {
data.Add(mockProject); data.Add(mockProject);
@ -288,7 +288,7 @@ public class ProjectsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void BulkDeleteProjects_OrganizationMistMatch_ThrowsNotFound( public async Task BulkDeleteProjects_OrganizationMistMatch_ThrowsNotFound(
SutProvider<ProjectsController> sutProvider, List<Project> data) SutProvider<ProjectsController> sutProvider, List<Project> data)
{ {
@ -299,7 +299,7 @@ public class ProjectsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void BulkDeleteProjects_NoAccessToSecretsManager_ThrowsNotFound( public async Task BulkDeleteProjects_NoAccessToSecretsManager_ThrowsNotFound(
SutProvider<ProjectsController> sutProvider, List<Project> data) SutProvider<ProjectsController> sutProvider, List<Project> data)
{ {
@ -316,7 +316,7 @@ public class ProjectsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void BulkDeleteProjects_ReturnsAccessDeniedForProjectsWithoutAccess_Success( public async Task BulkDeleteProjects_ReturnsAccessDeniedForProjectsWithoutAccess_Success(
SutProvider<ProjectsController> sutProvider, List<Project> data) SutProvider<ProjectsController> sutProvider, List<Project> data)
{ {
@ -346,7 +346,7 @@ public class ProjectsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void BulkDeleteProjects_Success(SutProvider<ProjectsController> sutProvider, List<Project> data) public async Task BulkDeleteProjects_Success(SutProvider<ProjectsController> sutProvider, List<Project> data)
{ {
var ids = data.Select(project => project.Id).ToList(); var ids = data.Select(project => project.Id).ToList();
var organizationId = data.First().OrganizationId; var organizationId = data.First().OrganizationId;

View File

@ -28,7 +28,7 @@ public class SecretsControllerTests
{ {
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetSecretsByOrganization_ReturnsEmptyList(SutProvider<SecretsController> sutProvider, Guid id, Guid organizationId, Guid userId, AccessClientType accessType) public async Task GetSecretsByOrganization_ReturnsEmptyList(SutProvider<SecretsController> sutProvider, Guid id, Guid organizationId, Guid userId, AccessClientType accessType)
{ {
sutProvider.GetDependency<ICurrentContext>().AccessSecretsManager(id).Returns(true); sutProvider.GetDependency<ICurrentContext>().AccessSecretsManager(id).Returns(true);
sutProvider.GetDependency<ICurrentContext>().OrganizationAdmin(organizationId).Returns(true); sutProvider.GetDependency<ICurrentContext>().OrganizationAdmin(organizationId).Returns(true);
@ -45,7 +45,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void GetSecretsByOrganization_Success(PermissionType permissionType, SutProvider<SecretsController> sutProvider, Core.SecretsManager.Entities.Secret resultSecret, Guid organizationId, Guid userId, Core.SecretsManager.Entities.Project mockProject, AccessClientType accessType) public async Task GetSecretsByOrganization_Success(PermissionType permissionType, SutProvider<SecretsController> sutProvider, Core.SecretsManager.Entities.Secret resultSecret, Guid organizationId, Guid userId, Core.SecretsManager.Entities.Project mockProject, AccessClientType accessType)
{ {
sutProvider.GetDependency<ICurrentContext>().AccessSecretsManager(default).ReturnsForAnyArgs(true); sutProvider.GetDependency<ICurrentContext>().AccessSecretsManager(default).ReturnsForAnyArgs(true);
sutProvider.GetDependency<ISecretRepository>().GetManyByOrganizationIdAsync(default, default, default) sutProvider.GetDependency<ISecretRepository>().GetManyByOrganizationIdAsync(default, default, default)
@ -76,7 +76,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetSecretsByOrganization_AccessDenied_Throws(SutProvider<SecretsController> sutProvider, Core.SecretsManager.Entities.Secret resultSecret) public async Task GetSecretsByOrganization_AccessDenied_Throws(SutProvider<SecretsController> sutProvider, Core.SecretsManager.Entities.Secret resultSecret)
{ {
sutProvider.GetDependency<ICurrentContext>().AccessSecretsManager(default).ReturnsForAnyArgs(false); sutProvider.GetDependency<ICurrentContext>().AccessSecretsManager(default).ReturnsForAnyArgs(false);
@ -86,7 +86,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetSecret_NotFound(SutProvider<SecretsController> sutProvider) public async Task GetSecret_NotFound(SutProvider<SecretsController> sutProvider)
{ {
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.GetAsync(Guid.NewGuid())); await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.GetAsync(Guid.NewGuid()));
} }
@ -94,7 +94,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData(PermissionType.RunAsAdmin)] [BitAutoData(PermissionType.RunAsAdmin)]
[BitAutoData(PermissionType.RunAsUserWithPermission)] [BitAutoData(PermissionType.RunAsUserWithPermission)]
public async void GetSecret_Success(PermissionType permissionType, SutProvider<SecretsController> sutProvider, Secret resultSecret, Guid userId, Guid organizationId, Project mockProject) public async Task GetSecret_Success(PermissionType permissionType, SutProvider<SecretsController> sutProvider, Secret resultSecret, Guid userId, Guid organizationId, Project mockProject)
{ {
sutProvider.GetDependency<ICurrentContext>().AccessSecretsManager(organizationId).Returns(true); sutProvider.GetDependency<ICurrentContext>().AccessSecretsManager(organizationId).Returns(true);
sutProvider.GetDependency<IUserService>().GetProperUserId(default).ReturnsForAnyArgs(userId); sutProvider.GetDependency<IUserService>().GetProperUserId(default).ReturnsForAnyArgs(userId);
@ -128,7 +128,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void CreateSecret_NoAccess_Throws(SutProvider<SecretsController> sutProvider, SecretCreateRequestModel data, Guid organizationId, Guid userId) public async Task CreateSecret_NoAccess_Throws(SutProvider<SecretsController> sutProvider, SecretCreateRequestModel data, Guid organizationId, Guid userId)
{ {
// We currently only allow a secret to be in one project at a time // We currently only allow a secret to be in one project at a time
if (data.ProjectIds != null && data.ProjectIds.Length > 1) if (data.ProjectIds != null && data.ProjectIds.Length > 1)
@ -152,7 +152,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void CreateSecret_Success(SutProvider<SecretsController> sutProvider, SecretCreateRequestModel data, Guid organizationId, Guid userId) public async Task CreateSecret_Success(SutProvider<SecretsController> sutProvider, SecretCreateRequestModel data, Guid organizationId, Guid userId)
{ {
// We currently only allow a secret to be in one project at a time // We currently only allow a secret to be in one project at a time
if (data.ProjectIds != null && data.ProjectIds.Length > 1) if (data.ProjectIds != null && data.ProjectIds.Length > 1)
@ -177,7 +177,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void UpdateSecret_NoAccess_Throws(SutProvider<SecretsController> sutProvider, SecretUpdateRequestModel data, Guid secretId, Guid organizationId, Secret mockSecret) public async Task UpdateSecret_NoAccess_Throws(SutProvider<SecretsController> sutProvider, SecretUpdateRequestModel data, Guid secretId, Guid organizationId, Secret mockSecret)
{ {
// We currently only allow a secret to be in one project at a time // We currently only allow a secret to be in one project at a time
if (data.ProjectIds != null && data.ProjectIds.Length > 1) if (data.ProjectIds != null && data.ProjectIds.Length > 1)
@ -200,7 +200,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void UpdateSecret_SecretDoesNotExist_Throws(SutProvider<SecretsController> sutProvider, SecretUpdateRequestModel data, Guid secretId, Guid organizationId) public async Task UpdateSecret_SecretDoesNotExist_Throws(SutProvider<SecretsController> sutProvider, SecretUpdateRequestModel data, Guid secretId, Guid organizationId)
{ {
// We currently only allow a secret to be in one project at a time // We currently only allow a secret to be in one project at a time
if (data.ProjectIds != null && data.ProjectIds.Length > 1) if (data.ProjectIds != null && data.ProjectIds.Length > 1)
@ -222,7 +222,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void UpdateSecret_Success(SutProvider<SecretsController> sutProvider, SecretUpdateRequestModel data, Guid secretId, Guid organizationId, Secret mockSecret) public async Task UpdateSecret_Success(SutProvider<SecretsController> sutProvider, SecretUpdateRequestModel data, Guid secretId, Guid organizationId, Secret mockSecret)
{ {
// We currently only allow a secret to be in one project at a time // We currently only allow a secret to be in one project at a time
if (data.ProjectIds != null && data.ProjectIds.Length > 1) if (data.ProjectIds != null && data.ProjectIds.Length > 1)
@ -245,7 +245,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void BulkDelete_NoSecretsFound_ThrowsNotFound(SutProvider<SecretsController> sutProvider, List<Secret> data) public async Task BulkDelete_NoSecretsFound_ThrowsNotFound(SutProvider<SecretsController> sutProvider, List<Secret> data)
{ {
var ids = data.Select(s => s.Id).ToList(); var ids = data.Select(s => s.Id).ToList();
sutProvider.GetDependency<ISecretRepository>().GetManyByIds(Arg.Is(ids)).ReturnsForAnyArgs(new List<Secret>()); sutProvider.GetDependency<ISecretRepository>().GetManyByIds(Arg.Is(ids)).ReturnsForAnyArgs(new List<Secret>());
@ -255,7 +255,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void BulkDelete_SecretsFoundMisMatch_ThrowsNotFound(SutProvider<SecretsController> sutProvider, List<Secret> data, Secret mockSecret) public async Task BulkDelete_SecretsFoundMisMatch_ThrowsNotFound(SutProvider<SecretsController> sutProvider, List<Secret> data, Secret mockSecret)
{ {
data.Add(mockSecret); data.Add(mockSecret);
var ids = data.Select(s => s.Id).ToList(); var ids = data.Select(s => s.Id).ToList();
@ -266,7 +266,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void BulkDelete_OrganizationMistMatch_ThrowsNotFound(SutProvider<SecretsController> sutProvider, List<Secret> data) public async Task BulkDelete_OrganizationMistMatch_ThrowsNotFound(SutProvider<SecretsController> sutProvider, List<Secret> data)
{ {
var ids = data.Select(s => s.Id).ToList(); var ids = data.Select(s => s.Id).ToList();
sutProvider.GetDependency<ISecretRepository>().GetManyByIds(Arg.Is(ids)).ReturnsForAnyArgs(data); sutProvider.GetDependency<ISecretRepository>().GetManyByIds(Arg.Is(ids)).ReturnsForAnyArgs(data);
@ -276,7 +276,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void BulkDelete_NoAccessToSecretsManager_ThrowsNotFound(SutProvider<SecretsController> sutProvider, List<Secret> data) public async Task BulkDelete_NoAccessToSecretsManager_ThrowsNotFound(SutProvider<SecretsController> sutProvider, List<Secret> data)
{ {
var ids = data.Select(s => s.Id).ToList(); var ids = data.Select(s => s.Id).ToList();
var organizationId = data.First().OrganizationId; var organizationId = data.First().OrganizationId;
@ -292,7 +292,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void BulkDelete_ReturnsAccessDeniedForSecretsWithoutAccess_Success(SutProvider<SecretsController> sutProvider, List<Secret> data) public async Task BulkDelete_ReturnsAccessDeniedForSecretsWithoutAccess_Success(SutProvider<SecretsController> sutProvider, List<Secret> data)
{ {
var ids = data.Select(s => s.Id).ToList(); var ids = data.Select(s => s.Id).ToList();
var organizationId = data.First().OrganizationId; var organizationId = data.First().OrganizationId;
@ -321,7 +321,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void BulkDelete_Success(SutProvider<SecretsController> sutProvider, List<Secret> data) public async Task BulkDelete_Success(SutProvider<SecretsController> sutProvider, List<Secret> data)
{ {
var ids = data.Select(sa => sa.Id).ToList(); var ids = data.Select(sa => sa.Id).ToList();
var organizationId = data.First().OrganizationId; var organizationId = data.First().OrganizationId;
@ -349,7 +349,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetSecretsByIds_NoSecretsFound_ThrowsNotFound(SutProvider<SecretsController> sutProvider, public async Task GetSecretsByIds_NoSecretsFound_ThrowsNotFound(SutProvider<SecretsController> sutProvider,
List<Secret> data) List<Secret> data)
{ {
var (ids, request) = BuildGetSecretsRequestModel(data); var (ids, request) = BuildGetSecretsRequestModel(data);
@ -359,7 +359,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetSecretsByIds_SecretsFoundMisMatch_ThrowsNotFound(SutProvider<SecretsController> sutProvider, public async Task GetSecretsByIds_SecretsFoundMisMatch_ThrowsNotFound(SutProvider<SecretsController> sutProvider,
List<Secret> data, Secret mockSecret) List<Secret> data, Secret mockSecret)
{ {
var (ids, request) = BuildGetSecretsRequestModel(data); var (ids, request) = BuildGetSecretsRequestModel(data);
@ -371,7 +371,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetSecretsByIds_OrganizationMisMatch_ThrowsNotFound(SutProvider<SecretsController> sutProvider, public async Task GetSecretsByIds_OrganizationMisMatch_ThrowsNotFound(SutProvider<SecretsController> sutProvider,
List<Secret> data) List<Secret> data)
{ {
var (ids, request) = BuildGetSecretsRequestModel(data); var (ids, request) = BuildGetSecretsRequestModel(data);
@ -381,7 +381,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetSecretsByIds_NoAccessToSecretsManager_ThrowsNotFound( public async Task GetSecretsByIds_NoAccessToSecretsManager_ThrowsNotFound(
SutProvider<SecretsController> sutProvider, List<Secret> data) SutProvider<SecretsController> sutProvider, List<Secret> data)
{ {
var (ids, request) = BuildGetSecretsRequestModel(data); var (ids, request) = BuildGetSecretsRequestModel(data);
@ -395,7 +395,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetSecretsByIds_AccessDenied_ThrowsNotFound(SutProvider<SecretsController> sutProvider, public async Task GetSecretsByIds_AccessDenied_ThrowsNotFound(SutProvider<SecretsController> sutProvider,
List<Secret> data) List<Secret> data)
{ {
var (ids, request) = BuildGetSecretsRequestModel(data); var (ids, request) = BuildGetSecretsRequestModel(data);
@ -413,7 +413,7 @@ public class SecretsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetSecretsByIds_Success(SutProvider<SecretsController> sutProvider, List<Secret> data) public async Task GetSecretsByIds_Success(SutProvider<SecretsController> sutProvider, List<Secret> data)
{ {
var (ids, request) = BuildGetSecretsRequestModel(data); var (ids, request) = BuildGetSecretsRequestModel(data);
var organizationId = SetOrganizations(ref data); var organizationId = SetOrganizations(ref data);

View File

@ -20,7 +20,7 @@ public class SecretsManagerEventsControllerTests
{ {
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetServiceAccountEvents_NoAccess_Throws(SutProvider<SecretsManagerEventsController> sutProvider, public async Task GetServiceAccountEvents_NoAccess_Throws(SutProvider<SecretsManagerEventsController> sutProvider,
ServiceAccount data) ServiceAccount data)
{ {
sutProvider.GetDependency<IServiceAccountRepository>().GetByIdAsync(default).ReturnsForAnyArgs(data); sutProvider.GetDependency<IServiceAccountRepository>().GetByIdAsync(default).ReturnsForAnyArgs(data);
@ -37,7 +37,7 @@ public class SecretsManagerEventsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetServiceAccountEvents_DateRangeOver_Throws( public async Task GetServiceAccountEvents_DateRangeOver_Throws(
SutProvider<SecretsManagerEventsController> sutProvider, SutProvider<SecretsManagerEventsController> sutProvider,
ServiceAccount data) ServiceAccount data)
{ {
@ -59,7 +59,7 @@ public class SecretsManagerEventsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetServiceAccountEvents_Success(SutProvider<SecretsManagerEventsController> sutProvider, public async Task GetServiceAccountEvents_Success(SutProvider<SecretsManagerEventsController> sutProvider,
ServiceAccount data) ServiceAccount data)
{ {
sutProvider.GetDependency<IServiceAccountRepository>().GetByIdAsync(default).ReturnsForAnyArgs(data); sutProvider.GetDependency<IServiceAccountRepository>().GetByIdAsync(default).ReturnsForAnyArgs(data);

View File

@ -31,7 +31,7 @@ public class ServiceAccountsControllerTests
{ {
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetServiceAccountsByOrganization_ReturnsEmptyList( public async Task GetServiceAccountsByOrganization_ReturnsEmptyList(
SutProvider<ServiceAccountsController> sutProvider, Guid id) SutProvider<ServiceAccountsController> sutProvider, Guid id)
{ {
sutProvider.GetDependency<ICurrentContext>().AccessSecretsManager(id).Returns(true); sutProvider.GetDependency<ICurrentContext>().AccessSecretsManager(id).Returns(true);
@ -47,7 +47,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetServiceAccountsByOrganization_Success(SutProvider<ServiceAccountsController> sutProvider, public async Task GetServiceAccountsByOrganization_Success(SutProvider<ServiceAccountsController> sutProvider,
ServiceAccountSecretsDetails resultServiceAccount) ServiceAccountSecretsDetails resultServiceAccount)
{ {
sutProvider.GetDependency<ICurrentContext>().AccessSecretsManager(default).ReturnsForAnyArgs(true); sutProvider.GetDependency<ICurrentContext>().AccessSecretsManager(default).ReturnsForAnyArgs(true);
@ -66,7 +66,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetServiceAccountsByOrganization_AccessDenied_Throws( public async Task GetServiceAccountsByOrganization_AccessDenied_Throws(
SutProvider<ServiceAccountsController> sutProvider, Guid orgId) SutProvider<ServiceAccountsController> sutProvider, Guid orgId)
{ {
sutProvider.GetDependency<ICurrentContext>().AccessSecretsManager(default).ReturnsForAnyArgs(false); sutProvider.GetDependency<ICurrentContext>().AccessSecretsManager(default).ReturnsForAnyArgs(false);
@ -77,7 +77,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void CreateServiceAccount_NoAccess_Throws(SutProvider<ServiceAccountsController> sutProvider, public async Task CreateServiceAccount_NoAccess_Throws(SutProvider<ServiceAccountsController> sutProvider,
ServiceAccountCreateRequestModel data, Guid organizationId) ServiceAccountCreateRequestModel data, Guid organizationId)
{ {
sutProvider.GetDependency<IAuthorizationService>() sutProvider.GetDependency<IAuthorizationService>()
@ -95,7 +95,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData(0)] [BitAutoData(0)]
public async void CreateServiceAccount_WhenAutoscalingNotRequired_DoesNotCallUpdateSubscription( public async Task CreateServiceAccount_WhenAutoscalingNotRequired_DoesNotCallUpdateSubscription(
int newSlotsRequired, SutProvider<ServiceAccountsController> sutProvider, int newSlotsRequired, SutProvider<ServiceAccountsController> sutProvider,
ServiceAccountCreateRequestModel data, Organization organization) ServiceAccountCreateRequestModel data, Organization organization)
{ {
@ -113,7 +113,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData(1)] [BitAutoData(1)]
[BitAutoData(2)] [BitAutoData(2)]
public async void CreateServiceAccount_WhenAutoscalingRequired_CallsUpdateSubscription(int newSlotsRequired, public async Task CreateServiceAccount_WhenAutoscalingRequired_CallsUpdateSubscription(int newSlotsRequired,
SutProvider<ServiceAccountsController> sutProvider, SutProvider<ServiceAccountsController> sutProvider,
ServiceAccountCreateRequestModel data, Organization organization) ServiceAccountCreateRequestModel data, Organization organization)
{ {
@ -135,7 +135,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void CreateServiceAccount_Success(SutProvider<ServiceAccountsController> sutProvider, public async Task CreateServiceAccount_Success(SutProvider<ServiceAccountsController> sutProvider,
ServiceAccountCreateRequestModel data, Guid organizationId, Organization mockOrg) ServiceAccountCreateRequestModel data, Guid organizationId, Organization mockOrg)
{ {
mockOrg.Id = organizationId; mockOrg.Id = organizationId;
@ -155,7 +155,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void UpdateServiceAccount_NoAccess_Throws(SutProvider<ServiceAccountsController> sutProvider, public async Task UpdateServiceAccount_NoAccess_Throws(SutProvider<ServiceAccountsController> sutProvider,
ServiceAccountUpdateRequestModel data, ServiceAccount existingServiceAccount) ServiceAccountUpdateRequestModel data, ServiceAccount existingServiceAccount)
{ {
sutProvider.GetDependency<IAuthorizationService>() sutProvider.GetDependency<IAuthorizationService>()
@ -174,7 +174,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void UpdateServiceAccount_Success(SutProvider<ServiceAccountsController> sutProvider, public async Task UpdateServiceAccount_Success(SutProvider<ServiceAccountsController> sutProvider,
ServiceAccountUpdateRequestModel data, ServiceAccount existingServiceAccount) ServiceAccountUpdateRequestModel data, ServiceAccount existingServiceAccount)
{ {
sutProvider.GetDependency<IAuthorizationService>() sutProvider.GetDependency<IAuthorizationService>()
@ -191,7 +191,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void CreateAccessToken_NoAccess_Throws(SutProvider<ServiceAccountsController> sutProvider, public async Task CreateAccessToken_NoAccess_Throws(SutProvider<ServiceAccountsController> sutProvider,
AccessTokenCreateRequestModel data, ServiceAccount serviceAccount, string mockClientSecret) AccessTokenCreateRequestModel data, ServiceAccount serviceAccount, string mockClientSecret)
{ {
sutProvider.GetDependency<IServiceAccountRepository>().GetByIdAsync(serviceAccount.Id).Returns(serviceAccount); sutProvider.GetDependency<IServiceAccountRepository>().GetByIdAsync(serviceAccount.Id).Returns(serviceAccount);
@ -212,7 +212,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void CreateAccessToken_Success(SutProvider<ServiceAccountsController> sutProvider, public async Task CreateAccessToken_Success(SutProvider<ServiceAccountsController> sutProvider,
AccessTokenCreateRequestModel data, ServiceAccount serviceAccount, string mockClientSecret) AccessTokenCreateRequestModel data, ServiceAccount serviceAccount, string mockClientSecret)
{ {
sutProvider.GetDependency<IServiceAccountRepository>().GetByIdAsync(serviceAccount.Id).Returns(serviceAccount); sutProvider.GetDependency<IServiceAccountRepository>().GetByIdAsync(serviceAccount.Id).Returns(serviceAccount);
@ -231,7 +231,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetAccessTokens_NoAccess_Throws(SutProvider<ServiceAccountsController> sutProvider, public async Task GetAccessTokens_NoAccess_Throws(SutProvider<ServiceAccountsController> sutProvider,
ServiceAccount data, ICollection<ApiKey> resultApiKeys) ServiceAccount data, ICollection<ApiKey> resultApiKeys)
{ {
sutProvider.GetDependency<IServiceAccountRepository>().GetByIdAsync(default).ReturnsForAnyArgs(data); sutProvider.GetDependency<IServiceAccountRepository>().GetByIdAsync(default).ReturnsForAnyArgs(data);
@ -254,7 +254,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetAccessTokens_Success(SutProvider<ServiceAccountsController> sutProvider, ServiceAccount data, public async Task GetAccessTokens_Success(SutProvider<ServiceAccountsController> sutProvider, ServiceAccount data,
ICollection<ApiKey> resultApiKeys) ICollection<ApiKey> resultApiKeys)
{ {
sutProvider.GetDependency<IServiceAccountRepository>().GetByIdAsync(default).ReturnsForAnyArgs(data); sutProvider.GetDependency<IServiceAccountRepository>().GetByIdAsync(default).ReturnsForAnyArgs(data);
@ -279,7 +279,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void RevokeAccessTokens_NoAccess_Throws(SutProvider<ServiceAccountsController> sutProvider, public async Task RevokeAccessTokens_NoAccess_Throws(SutProvider<ServiceAccountsController> sutProvider,
RevokeAccessTokensRequest data, ServiceAccount serviceAccount) RevokeAccessTokensRequest data, ServiceAccount serviceAccount)
{ {
sutProvider.GetDependency<IServiceAccountRepository>().GetByIdAsync(serviceAccount.Id).Returns(serviceAccount); sutProvider.GetDependency<IServiceAccountRepository>().GetByIdAsync(serviceAccount.Id).Returns(serviceAccount);
@ -295,7 +295,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void RevokeAccessTokens_Success(SutProvider<ServiceAccountsController> sutProvider, public async Task RevokeAccessTokens_Success(SutProvider<ServiceAccountsController> sutProvider,
RevokeAccessTokensRequest data, ServiceAccount serviceAccount) RevokeAccessTokensRequest data, ServiceAccount serviceAccount)
{ {
sutProvider.GetDependency<IServiceAccountRepository>().GetByIdAsync(serviceAccount.Id).Returns(serviceAccount); sutProvider.GetDependency<IServiceAccountRepository>().GetByIdAsync(serviceAccount.Id).Returns(serviceAccount);
@ -310,7 +310,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void BulkDelete_NoServiceAccountsFound_ThrowsNotFound(SutProvider<ServiceAccountsController> sutProvider, List<ServiceAccount> data) public async Task BulkDelete_NoServiceAccountsFound_ThrowsNotFound(SutProvider<ServiceAccountsController> sutProvider, List<ServiceAccount> data)
{ {
var ids = data.Select(sa => sa.Id).ToList(); var ids = data.Select(sa => sa.Id).ToList();
sutProvider.GetDependency<IServiceAccountRepository>().GetManyByIds(Arg.Is(ids)).ReturnsForAnyArgs(new List<ServiceAccount>()); sutProvider.GetDependency<IServiceAccountRepository>().GetManyByIds(Arg.Is(ids)).ReturnsForAnyArgs(new List<ServiceAccount>());
@ -320,7 +320,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void BulkDelete_ServiceAccountsFoundMisMatch_ThrowsNotFound(SutProvider<ServiceAccountsController> sutProvider, List<ServiceAccount> data, ServiceAccount mockSa) public async Task BulkDelete_ServiceAccountsFoundMisMatch_ThrowsNotFound(SutProvider<ServiceAccountsController> sutProvider, List<ServiceAccount> data, ServiceAccount mockSa)
{ {
data.Add(mockSa); data.Add(mockSa);
var ids = data.Select(sa => sa.Id).ToList(); var ids = data.Select(sa => sa.Id).ToList();
@ -331,7 +331,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void BulkDelete_OrganizationMistMatch_ThrowsNotFound(SutProvider<ServiceAccountsController> sutProvider, List<ServiceAccount> data) public async Task BulkDelete_OrganizationMistMatch_ThrowsNotFound(SutProvider<ServiceAccountsController> sutProvider, List<ServiceAccount> data)
{ {
var ids = data.Select(sa => sa.Id).ToList(); var ids = data.Select(sa => sa.Id).ToList();
sutProvider.GetDependency<IServiceAccountRepository>().GetManyByIds(Arg.Is(ids)).ReturnsForAnyArgs(data); sutProvider.GetDependency<IServiceAccountRepository>().GetManyByIds(Arg.Is(ids)).ReturnsForAnyArgs(data);
@ -341,7 +341,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void BulkDelete_NoAccessToSecretsManager_ThrowsNotFound(SutProvider<ServiceAccountsController> sutProvider, List<ServiceAccount> data) public async Task BulkDelete_NoAccessToSecretsManager_ThrowsNotFound(SutProvider<ServiceAccountsController> sutProvider, List<ServiceAccount> data)
{ {
var ids = data.Select(sa => sa.Id).ToList(); var ids = data.Select(sa => sa.Id).ToList();
var organizationId = data.First().OrganizationId; var organizationId = data.First().OrganizationId;
@ -357,7 +357,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void BulkDelete_ReturnsAccessDeniedForProjectsWithoutAccess_Success(SutProvider<ServiceAccountsController> sutProvider, List<ServiceAccount> data) public async Task BulkDelete_ReturnsAccessDeniedForProjectsWithoutAccess_Success(SutProvider<ServiceAccountsController> sutProvider, List<ServiceAccount> data)
{ {
var ids = data.Select(sa => sa.Id).ToList(); var ids = data.Select(sa => sa.Id).ToList();
var organizationId = data.First().OrganizationId; var organizationId = data.First().OrganizationId;
@ -386,7 +386,7 @@ public class ServiceAccountsControllerTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void BulkDelete_Success(SutProvider<ServiceAccountsController> sutProvider, List<ServiceAccount> data) public async Task BulkDelete_Success(SutProvider<ServiceAccountsController> sutProvider, List<ServiceAccount> data)
{ {
var ids = data.Select(sa => sa.Id).ToList(); var ids = data.Select(sa => sa.Id).ToList();
var organizationId = data.First().OrganizationId; var organizationId = data.First().OrganizationId;

View File

@ -313,7 +313,7 @@ public class SyncControllerTests
} }
private async void AssertMethodsCalledAsync(IUserService userService, private async Task AssertMethodsCalledAsync(IUserService userService,
IOrganizationUserRepository organizationUserRepository, IOrganizationUserRepository organizationUserRepository,
IProviderUserRepository providerUserRepository, IFolderRepository folderRepository, IProviderUserRepository providerUserRepository, IFolderRepository folderRepository,
ICipherRepository cipherRepository, ISendRepository sendRepository, ICipherRepository cipherRepository, ISendRepository sendRepository,

View File

@ -20,7 +20,7 @@ namespace Bit.Core.Test.Auth.UserFeatures.WebAuthnLogin;
public class AssertWebAuthnLoginCredentialCommandTests public class AssertWebAuthnLoginCredentialCommandTests
{ {
[Theory, BitAutoData] [Theory, BitAutoData]
internal async void InvalidUserHandle_ThrowsBadRequestException(SutProvider<AssertWebAuthnLoginCredentialCommand> sutProvider, AssertionOptions options, AuthenticatorAssertionRawResponse response) internal async Task InvalidUserHandle_ThrowsBadRequestException(SutProvider<AssertWebAuthnLoginCredentialCommand> sutProvider, AssertionOptions options, AuthenticatorAssertionRawResponse response)
{ {
// Arrange // Arrange
response.Response.UserHandle = Encoding.UTF8.GetBytes("invalid-user-handle"); response.Response.UserHandle = Encoding.UTF8.GetBytes("invalid-user-handle");
@ -33,7 +33,7 @@ public class AssertWebAuthnLoginCredentialCommandTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
internal async void UserNotFound_ThrowsBadRequestException(SutProvider<AssertWebAuthnLoginCredentialCommand> sutProvider, User user, AssertionOptions options, AuthenticatorAssertionRawResponse response) internal async Task UserNotFound_ThrowsBadRequestException(SutProvider<AssertWebAuthnLoginCredentialCommand> sutProvider, User user, AssertionOptions options, AuthenticatorAssertionRawResponse response)
{ {
// Arrange // Arrange
response.Response.UserHandle = user.Id.ToByteArray(); response.Response.UserHandle = user.Id.ToByteArray();
@ -47,7 +47,7 @@ public class AssertWebAuthnLoginCredentialCommandTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
internal async void NoMatchingCredentialExists_ThrowsBadRequestException(SutProvider<AssertWebAuthnLoginCredentialCommand> sutProvider, User user, AssertionOptions options, AuthenticatorAssertionRawResponse response) internal async Task NoMatchingCredentialExists_ThrowsBadRequestException(SutProvider<AssertWebAuthnLoginCredentialCommand> sutProvider, User user, AssertionOptions options, AuthenticatorAssertionRawResponse response)
{ {
// Arrange // Arrange
response.Response.UserHandle = user.Id.ToByteArray(); response.Response.UserHandle = user.Id.ToByteArray();
@ -62,7 +62,7 @@ public class AssertWebAuthnLoginCredentialCommandTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
internal async void AssertionFails_ThrowsBadRequestException(SutProvider<AssertWebAuthnLoginCredentialCommand> sutProvider, User user, AssertionOptions options, AuthenticatorAssertionRawResponse response, WebAuthnCredential credential, AssertionVerificationResult assertionResult) internal async Task AssertionFails_ThrowsBadRequestException(SutProvider<AssertWebAuthnLoginCredentialCommand> sutProvider, User user, AssertionOptions options, AuthenticatorAssertionRawResponse response, WebAuthnCredential credential, AssertionVerificationResult assertionResult)
{ {
// Arrange // Arrange
var credentialId = Guid.NewGuid().ToByteArray(); var credentialId = Guid.NewGuid().ToByteArray();
@ -83,7 +83,7 @@ public class AssertWebAuthnLoginCredentialCommandTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
internal async void AssertionSucceeds_ReturnsUserAndCredential(SutProvider<AssertWebAuthnLoginCredentialCommand> sutProvider, User user, AssertionOptions options, AuthenticatorAssertionRawResponse response, WebAuthnCredential credential, AssertionVerificationResult assertionResult) internal async Task AssertionSucceeds_ReturnsUserAndCredential(SutProvider<AssertWebAuthnLoginCredentialCommand> sutProvider, User user, AssertionOptions options, AuthenticatorAssertionRawResponse response, WebAuthnCredential credential, AssertionVerificationResult assertionResult)
{ {
// Arrange // Arrange
var credentialId = Guid.NewGuid().ToByteArray(); var credentialId = Guid.NewGuid().ToByteArray();

View File

@ -17,7 +17,7 @@ namespace Bit.Core.Test.Auth.UserFeatures.WebAuthnLogin;
public class CreateWebAuthnLoginCredentialCommandTests public class CreateWebAuthnLoginCredentialCommandTests
{ {
[Theory, BitAutoData] [Theory, BitAutoData]
internal async void ExceedsExistingCredentialsLimit_ReturnsFalse(SutProvider<CreateWebAuthnLoginCredentialCommand> sutProvider, User user, CredentialCreateOptions options, AuthenticatorAttestationRawResponse response, Generator<WebAuthnCredential> credentialGenerator) internal async Task ExceedsExistingCredentialsLimit_ReturnsFalse(SutProvider<CreateWebAuthnLoginCredentialCommand> sutProvider, User user, CredentialCreateOptions options, AuthenticatorAttestationRawResponse response, Generator<WebAuthnCredential> credentialGenerator)
{ {
// Arrange // Arrange
var existingCredentials = credentialGenerator.Take(CreateWebAuthnLoginCredentialCommand.MaxCredentialsPerUser).ToList(); var existingCredentials = credentialGenerator.Take(CreateWebAuthnLoginCredentialCommand.MaxCredentialsPerUser).ToList();
@ -32,7 +32,7 @@ public class CreateWebAuthnLoginCredentialCommandTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
internal async void DoesNotExceedExistingCredentialsLimit_CreatesCredential(SutProvider<CreateWebAuthnLoginCredentialCommand> sutProvider, User user, CredentialCreateOptions options, AuthenticatorAttestationRawResponse response, Generator<WebAuthnCredential> credentialGenerator) internal async Task DoesNotExceedExistingCredentialsLimit_CreatesCredential(SutProvider<CreateWebAuthnLoginCredentialCommand> sutProvider, User user, CredentialCreateOptions options, AuthenticatorAttestationRawResponse response, Generator<WebAuthnCredential> credentialGenerator)
{ {
// Arrange // Arrange
var existingCredentials = credentialGenerator.Take(CreateWebAuthnLoginCredentialCommand.MaxCredentialsPerUser - 1).ToList(); var existingCredentials = credentialGenerator.Take(CreateWebAuthnLoginCredentialCommand.MaxCredentialsPerUser - 1).ToList();

View File

@ -28,7 +28,7 @@ public class SelfHostedGetOrganizationLicenseQueryTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
[OrganizationLicenseCustomize] [OrganizationLicenseCustomize]
public async void GetLicenseAsync_Success(Organization organization, public async Task GetLicenseAsync_Success(Organization organization,
OrganizationConnection<BillingSyncConfig> billingSyncConnection, BillingSyncConfig config, OrganizationLicense license) OrganizationConnection<BillingSyncConfig> billingSyncConnection, BillingSyncConfig config, OrganizationLicense license)
{ {
var sutProvider = GetSutProvider(config, JsonSerializer.Serialize(license)); var sutProvider = GetSutProvider(config, JsonSerializer.Serialize(license));
@ -41,7 +41,7 @@ public class SelfHostedGetOrganizationLicenseQueryTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetLicenseAsync_WhenNotSelfHosted_Throws(Organization organization, public async Task GetLicenseAsync_WhenNotSelfHosted_Throws(Organization organization,
OrganizationConnection billingSyncConnection, BillingSyncConfig config) OrganizationConnection billingSyncConnection, BillingSyncConfig config)
{ {
var sutProvider = GetSutProvider(config); var sutProvider = GetSutProvider(config);
@ -54,7 +54,7 @@ public class SelfHostedGetOrganizationLicenseQueryTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetLicenseAsync_WhenCloudCommunicationDisabled_Throws(Organization organization, public async Task GetLicenseAsync_WhenCloudCommunicationDisabled_Throws(Organization organization,
OrganizationConnection billingSyncConnection, BillingSyncConfig config) OrganizationConnection billingSyncConnection, BillingSyncConfig config)
{ {
var sutProvider = GetSutProvider(config); var sutProvider = GetSutProvider(config);
@ -67,7 +67,7 @@ public class SelfHostedGetOrganizationLicenseQueryTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetLicenseAsync_WhenCantUseConnection_Throws(Organization organization, public async Task GetLicenseAsync_WhenCantUseConnection_Throws(Organization organization,
OrganizationConnection<BillingSyncConfig> billingSyncConnection, BillingSyncConfig config) OrganizationConnection<BillingSyncConfig> billingSyncConnection, BillingSyncConfig config)
{ {
var sutProvider = GetSutProvider(config); var sutProvider = GetSutProvider(config);
@ -80,7 +80,7 @@ public class SelfHostedGetOrganizationLicenseQueryTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void GetLicenseAsync_WhenNullResponse_Throws(Organization organization, public async Task GetLicenseAsync_WhenNullResponse_Throws(Organization organization,
OrganizationConnection<BillingSyncConfig> billingSyncConnection, BillingSyncConfig config) OrganizationConnection<BillingSyncConfig> billingSyncConnection, BillingSyncConfig config)
{ {
var sutProvider = GetSutProvider(config); var sutProvider = GetSutProvider(config);

View File

@ -25,7 +25,7 @@ public class StripePaymentServiceTests
[BitAutoData(PaymentMethodType.Credit)] [BitAutoData(PaymentMethodType.Credit)]
[BitAutoData(PaymentMethodType.WireTransfer)] [BitAutoData(PaymentMethodType.WireTransfer)]
[BitAutoData(PaymentMethodType.Check)] [BitAutoData(PaymentMethodType.Check)]
public async void PurchaseOrganizationAsync_Invalid(PaymentMethodType paymentMethodType, SutProvider<StripePaymentService> sutProvider) public async Task PurchaseOrganizationAsync_Invalid(PaymentMethodType paymentMethodType, SutProvider<StripePaymentService> sutProvider)
{ {
var exception = await Assert.ThrowsAsync<GatewayException>( var exception = await Assert.ThrowsAsync<GatewayException>(
() => sutProvider.Sut.PurchaseOrganizationAsync(null, paymentMethodType, null, null, 0, 0, false, null, false, -1, -1)); () => sutProvider.Sut.PurchaseOrganizationAsync(null, paymentMethodType, null, null, 0, 0, false, null, false, -1, -1));
@ -34,7 +34,7 @@ public class StripePaymentServiceTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
public async void PurchaseOrganizationAsync_Stripe_ProviderOrg_Coupon_Add(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo, bool provider = true) public async Task PurchaseOrganizationAsync_Stripe_ProviderOrg_Coupon_Add(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo, bool provider = true)
{ {
var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually); var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually);
@ -88,7 +88,7 @@ public class StripePaymentServiceTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
public async void PurchaseOrganizationAsync_SM_Stripe_ProviderOrg_Coupon_Add(SutProvider<StripePaymentService> sutProvider, Organization organization, public async Task PurchaseOrganizationAsync_SM_Stripe_ProviderOrg_Coupon_Add(SutProvider<StripePaymentService> sutProvider, Organization organization,
string paymentToken, TaxInfo taxInfo, bool provider = true) string paymentToken, TaxInfo taxInfo, bool provider = true)
{ {
var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually); var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually);
@ -145,7 +145,7 @@ public class StripePaymentServiceTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
public async void PurchaseOrganizationAsync_Stripe(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo) public async Task PurchaseOrganizationAsync_Stripe(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo)
{ {
var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually); var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually);
organization.UseSecretsManager = true; organization.UseSecretsManager = true;
@ -201,7 +201,7 @@ public class StripePaymentServiceTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
public async void PurchaseOrganizationAsync_Stripe_PM(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo) public async Task PurchaseOrganizationAsync_Stripe_PM(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo)
{ {
var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually); var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually);
paymentToken = "pm_" + paymentToken; paymentToken = "pm_" + paymentToken;
@ -258,7 +258,7 @@ public class StripePaymentServiceTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
public async void PurchaseOrganizationAsync_Stripe_Declined(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo) public async Task PurchaseOrganizationAsync_Stripe_Declined(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo)
{ {
var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually); var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually);
paymentToken = "pm_" + paymentToken; paymentToken = "pm_" + paymentToken;
@ -291,7 +291,7 @@ public class StripePaymentServiceTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
public async void PurchaseOrganizationAsync_SM_Stripe_Declined(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo) public async Task PurchaseOrganizationAsync_SM_Stripe_Declined(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo)
{ {
var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually); var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually);
paymentToken = "pm_" + paymentToken; paymentToken = "pm_" + paymentToken;
@ -325,7 +325,7 @@ public class StripePaymentServiceTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
public async void PurchaseOrganizationAsync_Stripe_RequiresAction(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo) public async Task PurchaseOrganizationAsync_Stripe_RequiresAction(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo)
{ {
var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually); var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually);
@ -356,7 +356,7 @@ public class StripePaymentServiceTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
public async void PurchaseOrganizationAsync_SM_Stripe_RequiresAction(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo) public async Task PurchaseOrganizationAsync_SM_Stripe_RequiresAction(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo)
{ {
var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually); var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually);
@ -388,7 +388,7 @@ public class StripePaymentServiceTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
public async void PurchaseOrganizationAsync_Paypal(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo) public async Task PurchaseOrganizationAsync_Paypal(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo)
{ {
var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually); var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually);
@ -452,7 +452,7 @@ public class StripePaymentServiceTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
public async void PurchaseOrganizationAsync_SM_Paypal(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo) public async Task PurchaseOrganizationAsync_SM_Paypal(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo)
{ {
var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually); var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually);
organization.UseSecretsManager = true; organization.UseSecretsManager = true;
@ -525,7 +525,7 @@ public class StripePaymentServiceTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
public async void PurchaseOrganizationAsync_Paypal_FailedCreate(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo) public async Task PurchaseOrganizationAsync_Paypal_FailedCreate(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo)
{ {
var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually); var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually);
@ -542,7 +542,7 @@ public class StripePaymentServiceTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
public async void PurchaseOrganizationAsync_SM_Paypal_FailedCreate(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo) public async Task PurchaseOrganizationAsync_SM_Paypal_FailedCreate(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo)
{ {
var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually); var plan = StaticStore.GetPlan(PlanType.EnterpriseAnnually);
@ -560,7 +560,7 @@ public class StripePaymentServiceTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
public async void PurchaseOrganizationAsync_PayPal_Declined(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo) public async Task PurchaseOrganizationAsync_PayPal_Declined(SutProvider<StripePaymentService> sutProvider, Organization organization, string paymentToken, TaxInfo taxInfo)
{ {
var plans = StaticStore.GetPlan(PlanType.EnterpriseAnnually); var plans = StaticStore.GetPlan(PlanType.EnterpriseAnnually);
paymentToken = "pm_" + paymentToken; paymentToken = "pm_" + paymentToken;
@ -604,7 +604,7 @@ public class StripePaymentServiceTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
public async void UpgradeFreeOrganizationAsync_Success(SutProvider<StripePaymentService> sutProvider, public async Task UpgradeFreeOrganizationAsync_Success(SutProvider<StripePaymentService> sutProvider,
Organization organization, TaxInfo taxInfo) Organization organization, TaxInfo taxInfo)
{ {
organization.GatewaySubscriptionId = null; organization.GatewaySubscriptionId = null;
@ -649,7 +649,7 @@ public class StripePaymentServiceTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
public async void UpgradeFreeOrganizationAsync_SM_Success(SutProvider<StripePaymentService> sutProvider, public async Task UpgradeFreeOrganizationAsync_SM_Success(SutProvider<StripePaymentService> sutProvider,
Organization organization, TaxInfo taxInfo) Organization organization, TaxInfo taxInfo)
{ {
organization.GatewaySubscriptionId = null; organization.GatewaySubscriptionId = null;
@ -694,7 +694,7 @@ public class StripePaymentServiceTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
public async void UpgradeFreeOrganizationAsync_WhenCustomerHasNoAddress_UpdatesCustomerAddressWithTaxInfo( public async Task UpgradeFreeOrganizationAsync_WhenCustomerHasNoAddress_UpdatesCustomerAddressWithTaxInfo(
SutProvider<StripePaymentService> sutProvider, SutProvider<StripePaymentService> sutProvider,
Organization organization, Organization organization,
TaxInfo taxInfo) TaxInfo taxInfo)

View File

@ -45,7 +45,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData(SendType.File)] [BitAutoData(SendType.File)]
[BitAutoData(SendType.Text)] [BitAutoData(SendType.Text)]
public async void SaveSendAsync_DisableSend_Applies_throws(SendType sendType, public async Task SaveSendAsync_DisableSend_Applies_throws(SendType sendType,
SutProvider<SendService> sutProvider, Send send) SutProvider<SendService> sutProvider, Send send)
{ {
SaveSendAsync_Setup(sendType, disableSendPolicyAppliesToUser: true, sutProvider, send); SaveSendAsync_Setup(sendType, disableSendPolicyAppliesToUser: true, sutProvider, send);
@ -56,7 +56,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData(SendType.File)] [BitAutoData(SendType.File)]
[BitAutoData(SendType.Text)] [BitAutoData(SendType.Text)]
public async void SaveSendAsync_DisableSend_DoesntApply_success(SendType sendType, public async Task SaveSendAsync_DisableSend_DoesntApply_success(SendType sendType,
SutProvider<SendService> sutProvider, Send send) SutProvider<SendService> sutProvider, Send send)
{ {
SaveSendAsync_Setup(sendType, disableSendPolicyAppliesToUser: false, sutProvider, send); SaveSendAsync_Setup(sendType, disableSendPolicyAppliesToUser: false, sutProvider, send);
@ -92,7 +92,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData(SendType.File)] [BitAutoData(SendType.File)]
[BitAutoData(SendType.Text)] [BitAutoData(SendType.Text)]
public async void SaveSendAsync_DisableHideEmail_Applies_throws(SendType sendType, public async Task SaveSendAsync_DisableHideEmail_Applies_throws(SendType sendType,
SutProvider<SendService> sutProvider, Send send, Policy policy) SutProvider<SendService> sutProvider, Send send, Policy policy)
{ {
SaveSendAsync_Setup(sendType, false, sutProvider, send); SaveSendAsync_Setup(sendType, false, sutProvider, send);
@ -104,7 +104,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData(SendType.File)] [BitAutoData(SendType.File)]
[BitAutoData(SendType.Text)] [BitAutoData(SendType.Text)]
public async void SaveSendAsync_DisableHideEmail_DoesntApply_success(SendType sendType, public async Task SaveSendAsync_DisableHideEmail_DoesntApply_success(SendType sendType,
SutProvider<SendService> sutProvider, Send send, Policy policy) SutProvider<SendService> sutProvider, Send send, Policy policy)
{ {
SaveSendAsync_Setup(sendType, false, sutProvider, send); SaveSendAsync_Setup(sendType, false, sutProvider, send);
@ -117,7 +117,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void SaveSendAsync_ExistingSend_Updates(SutProvider<SendService> sutProvider, public async Task SaveSendAsync_ExistingSend_Updates(SutProvider<SendService> sutProvider,
Send send) Send send)
{ {
send.Id = Guid.NewGuid(); send.Id = Guid.NewGuid();
@ -138,7 +138,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void SaveFileSendAsync_TextType_ThrowsBadRequest(SutProvider<SendService> sutProvider, public async Task SaveFileSendAsync_TextType_ThrowsBadRequest(SutProvider<SendService> sutProvider,
Send send) Send send)
{ {
send.Type = SendType.Text; send.Type = SendType.Text;
@ -152,7 +152,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void SaveFileSendAsync_EmptyFile_ThrowsBadRequest(SutProvider<SendService> sutProvider, public async Task SaveFileSendAsync_EmptyFile_ThrowsBadRequest(SutProvider<SendService> sutProvider,
Send send) Send send)
{ {
send.Type = SendType.File; send.Type = SendType.File;
@ -166,7 +166,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void SaveFileSendAsync_UserCannotAccessPremium_ThrowsBadRequest(SutProvider<SendService> sutProvider, public async Task SaveFileSendAsync_UserCannotAccessPremium_ThrowsBadRequest(SutProvider<SendService> sutProvider,
Send send) Send send)
{ {
var user = new User var user = new User
@ -194,7 +194,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void SaveFileSendAsync_UserHasUnconfirmedEmail_ThrowsBadRequest(SutProvider<SendService> sutProvider, public async Task SaveFileSendAsync_UserHasUnconfirmedEmail_ThrowsBadRequest(SutProvider<SendService> sutProvider,
Send send) Send send)
{ {
var user = new User var user = new User
@ -223,7 +223,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void SaveFileSendAsync_UserCanAccessPremium_HasNoStorage_ThrowsBadRequest(SutProvider<SendService> sutProvider, public async Task SaveFileSendAsync_UserCanAccessPremium_HasNoStorage_ThrowsBadRequest(SutProvider<SendService> sutProvider,
Send send) Send send)
{ {
var user = new User var user = new User
@ -255,7 +255,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void SaveFileSendAsync_UserCanAccessPremium_StorageFull_ThrowsBadRequest(SutProvider<SendService> sutProvider, public async Task SaveFileSendAsync_UserCanAccessPremium_StorageFull_ThrowsBadRequest(SutProvider<SendService> sutProvider,
Send send) Send send)
{ {
var user = new User var user = new User
@ -287,7 +287,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void SaveFileSendAsync_UserCanAccessPremium_IsNotPremium_IsSelfHosted_GiantFile_ThrowsBadRequest(SutProvider<SendService> sutProvider, public async Task SaveFileSendAsync_UserCanAccessPremium_IsNotPremium_IsSelfHosted_GiantFile_ThrowsBadRequest(SutProvider<SendService> sutProvider,
Send send) Send send)
{ {
var user = new User var user = new User
@ -320,7 +320,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void SaveFileSendAsync_UserCanAccessPremium_IsNotPremium_IsNotSelfHosted_TwoGigabyteFile_ThrowsBadRequest(SutProvider<SendService> sutProvider, public async Task SaveFileSendAsync_UserCanAccessPremium_IsNotPremium_IsNotSelfHosted_TwoGigabyteFile_ThrowsBadRequest(SutProvider<SendService> sutProvider,
Send send) Send send)
{ {
var user = new User var user = new User
@ -353,7 +353,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void SaveFileSendAsync_ThroughOrg_MaxStorageIsNull_ThrowsBadRequest(SutProvider<SendService> sutProvider, public async Task SaveFileSendAsync_ThroughOrg_MaxStorageIsNull_ThrowsBadRequest(SutProvider<SendService> sutProvider,
Send send) Send send)
{ {
var org = new Organization var org = new Organization
@ -379,7 +379,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void SaveFileSendAsync_ThroughOrg_MaxStorageIsNull_TwoGBFile_ThrowsBadRequest(SutProvider<SendService> sutProvider, public async Task SaveFileSendAsync_ThroughOrg_MaxStorageIsNull_TwoGBFile_ThrowsBadRequest(SutProvider<SendService> sutProvider,
Send send) Send send)
{ {
var org = new Organization var org = new Organization
@ -405,7 +405,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void SaveFileSendAsync_ThroughOrg_MaxStorageIsOneGB_TwoGBFile_ThrowsBadRequest(SutProvider<SendService> sutProvider, public async Task SaveFileSendAsync_ThroughOrg_MaxStorageIsOneGB_TwoGBFile_ThrowsBadRequest(SutProvider<SendService> sutProvider,
Send send) Send send)
{ {
var org = new Organization var org = new Organization
@ -431,7 +431,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void SaveFileSendAsync_HasEnoughStorage_Success(SutProvider<SendService> sutProvider, public async Task SaveFileSendAsync_HasEnoughStorage_Success(SutProvider<SendService> sutProvider,
Send send) Send send)
{ {
var user = new User var user = new User
@ -485,7 +485,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void SaveFileSendAsync_HasEnoughStorage_SendFileThrows_CleansUp(SutProvider<SendService> sutProvider, public async Task SaveFileSendAsync_HasEnoughStorage_SendFileThrows_CleansUp(SutProvider<SendService> sutProvider,
Send send) Send send)
{ {
var user = new User var user = new User
@ -543,7 +543,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void UpdateFileToExistingSendAsync_SendNull_ThrowsBadRequest(SutProvider<SendService> sutProvider) public async Task UpdateFileToExistingSendAsync_SendNull_ThrowsBadRequest(SutProvider<SendService> sutProvider)
{ {
var badRequest = await Assert.ThrowsAsync<BadRequestException>(() => var badRequest = await Assert.ThrowsAsync<BadRequestException>(() =>
@ -555,7 +555,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void UpdateFileToExistingSendAsync_SendDataNull_ThrowsBadRequest(SutProvider<SendService> sutProvider, public async Task UpdateFileToExistingSendAsync_SendDataNull_ThrowsBadRequest(SutProvider<SendService> sutProvider,
Send send) Send send)
{ {
send.Data = null; send.Data = null;
@ -569,7 +569,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void UpdateFileToExistingSendAsync_NotFileType_ThrowsBadRequest(SutProvider<SendService> sutProvider, public async Task UpdateFileToExistingSendAsync_NotFileType_ThrowsBadRequest(SutProvider<SendService> sutProvider,
Send send) Send send)
{ {
var badRequest = await Assert.ThrowsAsync<BadRequestException>(() => var badRequest = await Assert.ThrowsAsync<BadRequestException>(() =>
@ -581,7 +581,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void UpdateFileToExistingSendAsync_Success(SutProvider<SendService> sutProvider, public async Task UpdateFileToExistingSendAsync_Success(SutProvider<SendService> sutProvider,
Send send) Send send)
{ {
var fileContents = "Test file content"; var fileContents = "Test file content";
@ -605,7 +605,7 @@ public class SendServiceTests
[Theory] [Theory]
[BitAutoData] [BitAutoData]
public async void UpdateFileToExistingSendAsync_InvalidSize(SutProvider<SendService> sutProvider, public async Task UpdateFileToExistingSendAsync_InvalidSize(SutProvider<SendService> sutProvider,
Send send) Send send)
{ {
var fileContents = "Test file content"; var fileContents = "Test file content";

View File

@ -14,7 +14,7 @@ namespace Bit.Infrastructure.EFIntegration.Test.Repositories;
public class OrganizationRepositoryTests public class OrganizationRepositoryTests
{ {
[CiSkippedTheory, EfOrganizationAutoData] [CiSkippedTheory, EfOrganizationAutoData]
public async void CreateAsync_Works_DataMatches( public async Task CreateAsync_Works_DataMatches(
Organization organization, Organization organization,
SqlRepo.OrganizationRepository sqlOrganizationRepo, OrganizationCompare equalityComparer, SqlRepo.OrganizationRepository sqlOrganizationRepo, OrganizationCompare equalityComparer,
List<EfRepo.OrganizationRepository> suts) List<EfRepo.OrganizationRepository> suts)
@ -37,7 +37,7 @@ public class OrganizationRepositoryTests
} }
[CiSkippedTheory, EfOrganizationAutoData] [CiSkippedTheory, EfOrganizationAutoData]
public async void ReplaceAsync_Works_DataMatches(Organization postOrganization, public async Task ReplaceAsync_Works_DataMatches(Organization postOrganization,
Organization replaceOrganization, SqlRepo.OrganizationRepository sqlOrganizationRepo, Organization replaceOrganization, SqlRepo.OrganizationRepository sqlOrganizationRepo,
OrganizationCompare equalityComparer, List<EfRepo.OrganizationRepository> suts) OrganizationCompare equalityComparer, List<EfRepo.OrganizationRepository> suts)
{ {
@ -65,7 +65,7 @@ public class OrganizationRepositoryTests
} }
[CiSkippedTheory, EfOrganizationAutoData] [CiSkippedTheory, EfOrganizationAutoData]
public async void DeleteAsync_Works_DataMatches(Organization organization, public async Task DeleteAsync_Works_DataMatches(Organization organization,
SqlRepo.OrganizationRepository sqlOrganizationRepo, List<EfRepo.OrganizationRepository> suts) SqlRepo.OrganizationRepository sqlOrganizationRepo, List<EfRepo.OrganizationRepository> suts)
{ {
foreach (var sut in suts) foreach (var sut in suts)
@ -94,7 +94,7 @@ public class OrganizationRepositoryTests
} }
[CiSkippedTheory, EfOrganizationAutoData] [CiSkippedTheory, EfOrganizationAutoData]
public async void GetByIdentifierAsync_Works_DataMatches(Organization organization, public async Task GetByIdentifierAsync_Works_DataMatches(Organization organization,
SqlRepo.OrganizationRepository sqlOrganizationRepo, OrganizationCompare equalityComparer, SqlRepo.OrganizationRepository sqlOrganizationRepo, OrganizationCompare equalityComparer,
List<EfRepo.OrganizationRepository> suts) List<EfRepo.OrganizationRepository> suts)
{ {
@ -116,7 +116,7 @@ public class OrganizationRepositoryTests
} }
[CiSkippedTheory, EfOrganizationAutoData] [CiSkippedTheory, EfOrganizationAutoData]
public async void GetManyByEnabledAsync_Works_DataMatches(Organization organization, public async Task GetManyByEnabledAsync_Works_DataMatches(Organization organization,
SqlRepo.OrganizationRepository sqlOrganizationRepo, List<EfRepo.OrganizationRepository> suts) SqlRepo.OrganizationRepository sqlOrganizationRepo, List<EfRepo.OrganizationRepository> suts)
{ {
var returnedOrgs = new List<Organization>(); var returnedOrgs = new List<Organization>();
@ -137,7 +137,7 @@ public class OrganizationRepositoryTests
// testing data matches here would require manipulating all organization abilities in the db // testing data matches here would require manipulating all organization abilities in the db
[CiSkippedTheory, EfOrganizationAutoData] [CiSkippedTheory, EfOrganizationAutoData]
public async void GetManyAbilitiesAsync_Works(SqlRepo.OrganizationRepository sqlOrganizationRepo, List<EfRepo.OrganizationRepository> suts) public async Task GetManyAbilitiesAsync_Works(SqlRepo.OrganizationRepository sqlOrganizationRepo, List<EfRepo.OrganizationRepository> suts)
{ {
var list = new List<OrganizationAbility>(); var list = new List<OrganizationAbility>();
foreach (var sut in suts) foreach (var sut in suts)
@ -150,7 +150,7 @@ public class OrganizationRepositoryTests
} }
[CiSkippedTheory, EfOrganizationUserAutoData] [CiSkippedTheory, EfOrganizationUserAutoData]
public async void SearchUnassignedAsync_Works(OrganizationUser orgUser, User user, Organization org, public async Task SearchUnassignedAsync_Works(OrganizationUser orgUser, User user, Organization org,
List<EfRepo.OrganizationUserRepository> efOrgUserRepos, List<EfRepo.OrganizationRepository> efOrgRepos, List<EfRepo.UserRepository> efUserRepos, List<EfRepo.OrganizationUserRepository> efOrgUserRepos, List<EfRepo.OrganizationRepository> efOrgRepos, List<EfRepo.UserRepository> efUserRepos,
SqlRepo.OrganizationUserRepository sqlOrgUserRepo, SqlRepo.OrganizationRepository sqlOrgRepo, SqlRepo.UserRepository sqlUserRepo) SqlRepo.OrganizationUserRepository sqlOrgUserRepo, SqlRepo.OrganizationRepository sqlOrgRepo, SqlRepo.UserRepository sqlUserRepo)
{ {

View File

@ -23,7 +23,7 @@ namespace Bit.Infrastructure.EFIntegration.Test.Repositories;
public class OrganizationUserRepositoryTests public class OrganizationUserRepositoryTests
{ {
[CiSkippedTheory, EfOrganizationUserAutoData] [CiSkippedTheory, EfOrganizationUserAutoData]
public async void CreateAsync_Works_DataMatches(OrganizationUser orgUser, User user, Organization org, public async Task CreateAsync_Works_DataMatches(OrganizationUser orgUser, User user, Organization org,
OrganizationUserCompare equalityComparer, List<EfRepo.OrganizationUserRepository> suts, OrganizationUserCompare equalityComparer, List<EfRepo.OrganizationUserRepository> suts,
List<EfRepo.OrganizationRepository> efOrgRepos, List<EfRepo.UserRepository> efUserRepos, List<EfRepo.OrganizationRepository> efOrgRepos, List<EfRepo.UserRepository> efUserRepos,
SqlRepo.OrganizationUserRepository sqlOrgUserRepo, SqlRepo.UserRepository sqlUserRepo, SqlRepo.OrganizationUserRepository sqlOrgUserRepo, SqlRepo.UserRepository sqlUserRepo,
@ -61,7 +61,7 @@ public class OrganizationUserRepositoryTests
} }
[CiSkippedTheory, EfOrganizationUserAutoData] [CiSkippedTheory, EfOrganizationUserAutoData]
public async void ReplaceAsync_Works_DataMatches( public async Task ReplaceAsync_Works_DataMatches(
OrganizationUser postOrgUser, OrganizationUser postOrgUser,
OrganizationUser replaceOrgUser, OrganizationUser replaceOrgUser,
User user, User user,
@ -113,7 +113,7 @@ public class OrganizationUserRepositoryTests
} }
[CiSkippedTheory, EfOrganizationUserAutoData] [CiSkippedTheory, EfOrganizationUserAutoData]
public async void DeleteAsync_Works_DataMatches(OrganizationUser orgUser, User user, Organization org, List<EfRepo.OrganizationUserRepository> suts, public async Task DeleteAsync_Works_DataMatches(OrganizationUser orgUser, User user, Organization org, List<EfRepo.OrganizationUserRepository> suts,
List<EfRepo.UserRepository> efUserRepos, List<EfRepo.OrganizationRepository> efOrgRepos, List<EfRepo.UserRepository> efUserRepos, List<EfRepo.OrganizationRepository> efOrgRepos,
SqlRepo.OrganizationUserRepository sqlOrgUserRepo, SqlRepo.UserRepository sqlUserRepo, SqlRepo.OrganizationUserRepository sqlOrgUserRepo, SqlRepo.UserRepository sqlUserRepo,
SqlRepo.OrganizationRepository sqlOrgRepo) SqlRepo.OrganizationRepository sqlOrgRepo)
@ -166,7 +166,7 @@ public class OrganizationUserRepositoryTests
[EfPolicyApplicableToUserInlineAutoData(OrganizationUserType.User, false, OrganizationUserStatusType.Confirmed, false, false)] // Policy disabled [EfPolicyApplicableToUserInlineAutoData(OrganizationUserType.User, false, OrganizationUserStatusType.Confirmed, false, false)] // Policy disabled
[EfPolicyApplicableToUserInlineAutoData(OrganizationUserType.User, false, OrganizationUserStatusType.Confirmed, true, false)] // No policy of Type [EfPolicyApplicableToUserInlineAutoData(OrganizationUserType.User, false, OrganizationUserStatusType.Confirmed, true, false)] // No policy of Type
[EfPolicyApplicableToUserInlineAutoData(OrganizationUserType.User, false, OrganizationUserStatusType.Invited, true, false)] // User not minStatus [EfPolicyApplicableToUserInlineAutoData(OrganizationUserType.User, false, OrganizationUserStatusType.Invited, true, false)] // User not minStatus
public async void GetByUserIdWithPolicyDetailsAsync_Works_DataMatches( public async Task GetByUserIdWithPolicyDetailsAsync_Works_DataMatches(
// Inline data // Inline data
OrganizationUserType userType, OrganizationUserType userType,
bool canManagePolicies, bool canManagePolicies,

View File

@ -14,7 +14,7 @@ namespace Bit.Infrastructure.EFIntegration.Test.AdminConsole.Repositories;
public class PolicyRepositoryTests public class PolicyRepositoryTests
{ {
[CiSkippedTheory, EfPolicyAutoData] [CiSkippedTheory, EfPolicyAutoData]
public async void CreateAsync_Works_DataMatches( public async Task CreateAsync_Works_DataMatches(
Policy policy, Policy policy,
Organization organization, Organization organization,
PolicyCompare equalityComparer, PolicyCompare equalityComparer,

View File

@ -15,7 +15,7 @@ namespace Bit.Infrastructure.EFIntegration.Test.Auth.Repositories;
public class AuthRequestRepositoryTests public class AuthRequestRepositoryTests
{ {
[CiSkippedTheory, EfAuthRequestAutoData] [CiSkippedTheory, EfAuthRequestAutoData]
public async void CreateAsync_Works_DataMatches( public async Task CreateAsync_Works_DataMatches(
AuthRequest authRequest, AuthRequest authRequest,
AuthRequestCompare equalityComparer, AuthRequestCompare equalityComparer,
List<EfAuthRepo.AuthRequestRepository> suts, List<EfAuthRepo.AuthRequestRepository> suts,

View File

@ -14,7 +14,7 @@ namespace Bit.Infrastructure.EFIntegration.Test.Auth.Repositories;
public class EmergencyAccessRepositoryTests public class EmergencyAccessRepositoryTests
{ {
[CiSkippedTheory, EfEmergencyAccessAutoData] [CiSkippedTheory, EfEmergencyAccessAutoData]
public async void CreateAsync_Works_DataMatches( public async Task CreateAsync_Works_DataMatches(
EmergencyAccess emergencyAccess, EmergencyAccess emergencyAccess,
List<User> users, List<User> users,
EmergencyAccessCompare equalityComparer, EmergencyAccessCompare equalityComparer,

View File

@ -13,7 +13,7 @@ namespace Bit.Infrastructure.EFIntegration.Test.Auth.Repositories;
public class SsoConfigRepositoryTests public class SsoConfigRepositoryTests
{ {
[CiSkippedTheory, EfSsoConfigAutoData] [CiSkippedTheory, EfSsoConfigAutoData]
public async void CreateAsync_Works_DataMatches(SsoConfig ssoConfig, Organization org, public async Task CreateAsync_Works_DataMatches(SsoConfig ssoConfig, Organization org,
SsoConfigCompare equalityComparer, List<EfRepo.SsoConfigRepository> suts, SsoConfigCompare equalityComparer, List<EfRepo.SsoConfigRepository> suts,
List<EfRepo.OrganizationRepository> efOrgRepos, SqlAuthRepo.SsoConfigRepository sqlSsoConfigRepo, List<EfRepo.OrganizationRepository> efOrgRepos, SqlAuthRepo.SsoConfigRepository sqlSsoConfigRepo,
SqlRepo.OrganizationRepository sqlOrganizationRepo) SqlRepo.OrganizationRepository sqlOrganizationRepo)
@ -49,7 +49,7 @@ public class SsoConfigRepositoryTests
} }
[CiSkippedTheory, EfSsoConfigAutoData] [CiSkippedTheory, EfSsoConfigAutoData]
public async void ReplaceAsync_Works_DataMatches(SsoConfig postSsoConfig, SsoConfig replaceSsoConfig, public async Task ReplaceAsync_Works_DataMatches(SsoConfig postSsoConfig, SsoConfig replaceSsoConfig,
Organization org, SsoConfigCompare equalityComparer, List<EfRepo.SsoConfigRepository> suts, Organization org, SsoConfigCompare equalityComparer, List<EfRepo.SsoConfigRepository> suts,
List<EfRepo.OrganizationRepository> efOrgRepos, SqlAuthRepo.SsoConfigRepository sqlSsoConfigRepo, List<EfRepo.OrganizationRepository> efOrgRepos, SqlAuthRepo.SsoConfigRepository sqlSsoConfigRepo,
SqlRepo.OrganizationRepository sqlOrganizationRepo) SqlRepo.OrganizationRepository sqlOrganizationRepo)
@ -94,7 +94,7 @@ public class SsoConfigRepositoryTests
} }
[CiSkippedTheory, EfSsoConfigAutoData] [CiSkippedTheory, EfSsoConfigAutoData]
public async void DeleteAsync_Works_DataMatches(SsoConfig ssoConfig, Organization org, List<EfRepo.SsoConfigRepository> suts, public async Task DeleteAsync_Works_DataMatches(SsoConfig ssoConfig, Organization org, List<EfRepo.SsoConfigRepository> suts,
List<EfRepo.OrganizationRepository> efOrgRepos, SqlAuthRepo.SsoConfigRepository sqlSsoConfigRepo, List<EfRepo.OrganizationRepository> efOrgRepos, SqlAuthRepo.SsoConfigRepository sqlSsoConfigRepo,
SqlRepo.OrganizationRepository sqlOrganizationRepo) SqlRepo.OrganizationRepository sqlOrganizationRepo)
{ {
@ -131,7 +131,7 @@ public class SsoConfigRepositoryTests
} }
[CiSkippedTheory, EfSsoConfigAutoData] [CiSkippedTheory, EfSsoConfigAutoData]
public async void GetByOrganizationIdAsync_Works_DataMatches(SsoConfig ssoConfig, Organization org, public async Task GetByOrganizationIdAsync_Works_DataMatches(SsoConfig ssoConfig, Organization org,
SsoConfigCompare equalityComparer, List<EfRepo.SsoConfigRepository> suts, SsoConfigCompare equalityComparer, List<EfRepo.SsoConfigRepository> suts,
List<EfRepo.OrganizationRepository> efOrgRepos, SqlAuthRepo.SsoConfigRepository sqlSsoConfigRepo, List<EfRepo.OrganizationRepository> efOrgRepos, SqlAuthRepo.SsoConfigRepository sqlSsoConfigRepo,
SqlRepo.OrganizationRepository sqlOrgRepo) SqlRepo.OrganizationRepository sqlOrgRepo)
@ -168,7 +168,7 @@ public class SsoConfigRepositoryTests
} }
[CiSkippedTheory, EfSsoConfigAutoData] [CiSkippedTheory, EfSsoConfigAutoData]
public async void GetByIdentifierAsync_Works_DataMatches(SsoConfig ssoConfig, Organization org, public async Task GetByIdentifierAsync_Works_DataMatches(SsoConfig ssoConfig, Organization org,
SsoConfigCompare equalityComparer, List<EfRepo.SsoConfigRepository> suts, SsoConfigCompare equalityComparer, List<EfRepo.SsoConfigRepository> suts,
List<EfRepo.OrganizationRepository> efOrgRepos, SqlAuthRepo.SsoConfigRepository sqlSsoConfigRepo, List<EfRepo.OrganizationRepository> efOrgRepos, SqlAuthRepo.SsoConfigRepository sqlSsoConfigRepo,
SqlRepo.OrganizationRepository sqlOrgRepo) SqlRepo.OrganizationRepository sqlOrgRepo)
@ -206,7 +206,7 @@ public class SsoConfigRepositoryTests
// Testing that data matches here would involve manipulating all SsoConfig records in the db // Testing that data matches here would involve manipulating all SsoConfig records in the db
[CiSkippedTheory, EfSsoConfigAutoData] [CiSkippedTheory, EfSsoConfigAutoData]
public async void GetManyByRevisionNotBeforeDate_Works(SsoConfig ssoConfig, DateTime notBeforeDate, public async Task GetManyByRevisionNotBeforeDate_Works(SsoConfig ssoConfig, DateTime notBeforeDate,
Organization org, List<EfRepo.SsoConfigRepository> suts, Organization org, List<EfRepo.SsoConfigRepository> suts,
List<EfRepo.OrganizationRepository> efOrgRepos) List<EfRepo.OrganizationRepository> efOrgRepos)
{ {

View File

@ -14,7 +14,7 @@ namespace Bit.Infrastructure.EFIntegration.Test.Auth.Repositories;
public class SsoUserRepositoryTests public class SsoUserRepositoryTests
{ {
[CiSkippedTheory, EfSsoUserAutoData] [CiSkippedTheory, EfSsoUserAutoData]
public async void CreateAsync_Works_DataMatches(SsoUser ssoUser, User user, Organization org, public async Task CreateAsync_Works_DataMatches(SsoUser ssoUser, User user, Organization org,
SsoUserCompare equalityComparer, List<EfRepo.SsoUserRepository> suts, SsoUserCompare equalityComparer, List<EfRepo.SsoUserRepository> suts,
List<EfRepo.OrganizationRepository> efOrgRepos, List<EfRepo.UserRepository> efUserRepos, List<EfRepo.OrganizationRepository> efOrgRepos, List<EfRepo.UserRepository> efUserRepos,
SqlAuthRepo.SsoUserRepository sqlSsoUserRepo, SqlRepo.OrganizationRepository sqlOrgRepo, SqlAuthRepo.SsoUserRepository sqlSsoUserRepo, SqlRepo.OrganizationRepository sqlOrgRepo,
@ -52,7 +52,7 @@ public class SsoUserRepositoryTests
} }
[CiSkippedTheory, EfSsoUserAutoData] [CiSkippedTheory, EfSsoUserAutoData]
public async void ReplaceAsync_Works_DataMatches(SsoUser postSsoUser, SsoUser replaceSsoUser, public async Task ReplaceAsync_Works_DataMatches(SsoUser postSsoUser, SsoUser replaceSsoUser,
Organization org, User user, SsoUserCompare equalityComparer, Organization org, User user, SsoUserCompare equalityComparer,
List<EfRepo.SsoUserRepository> suts, List<EfRepo.UserRepository> efUserRepos, List<EfRepo.SsoUserRepository> suts, List<EfRepo.UserRepository> efUserRepos,
List<EfRepo.OrganizationRepository> efOrgRepos, SqlAuthRepo.SsoUserRepository sqlSsoUserRepo, List<EfRepo.OrganizationRepository> efOrgRepos, SqlAuthRepo.SsoUserRepository sqlSsoUserRepo,
@ -101,7 +101,7 @@ public class SsoUserRepositoryTests
} }
[CiSkippedTheory, EfSsoUserAutoData] [CiSkippedTheory, EfSsoUserAutoData]
public async void DeleteAsync_Works_DataMatches(SsoUser ssoUser, Organization org, User user, List<EfRepo.SsoUserRepository> suts, public async Task DeleteAsync_Works_DataMatches(SsoUser ssoUser, Organization org, User user, List<EfRepo.SsoUserRepository> suts,
List<EfRepo.UserRepository> efUserRepos, List<EfRepo.OrganizationRepository> efOrgRepos, List<EfRepo.UserRepository> efUserRepos, List<EfRepo.OrganizationRepository> efOrgRepos,
SqlAuthRepo.SsoUserRepository sqlSsoUserRepo, SqlRepo.UserRepository sqlUserRepo, SqlAuthRepo.SsoUserRepository sqlSsoUserRepo, SqlRepo.UserRepository sqlUserRepo,
SqlRepo.OrganizationRepository sqlOrganizationRepo) SqlRepo.OrganizationRepository sqlOrganizationRepo)
@ -143,7 +143,7 @@ public class SsoUserRepositoryTests
} }
[CiSkippedTheory, EfSsoUserAutoData] [CiSkippedTheory, EfSsoUserAutoData]
public async void DeleteAsync_UserIdOrganizationId_Works_DataMatches(SsoUser ssoUser, public async Task DeleteAsync_UserIdOrganizationId_Works_DataMatches(SsoUser ssoUser,
User user, Organization org, List<EfRepo.SsoUserRepository> suts, User user, Organization org, List<EfRepo.SsoUserRepository> suts,
List<EfRepo.UserRepository> efUserRepos, List<EfRepo.OrganizationRepository> efOrgRepos, List<EfRepo.UserRepository> efUserRepos, List<EfRepo.OrganizationRepository> efOrgRepos,
SqlAuthRepo.SsoUserRepository sqlSsoUserRepo, SqlRepo.UserRepository sqlUserRepo, SqlRepo.OrganizationRepository sqlOrgRepo SqlAuthRepo.SsoUserRepository sqlSsoUserRepo, SqlRepo.UserRepository sqlUserRepo, SqlRepo.OrganizationRepository sqlOrgRepo

View File

@ -14,7 +14,7 @@ namespace Bit.Infrastructure.EFIntegration.Test.Repositories;
public class CollectionRepositoryTests public class CollectionRepositoryTests
{ {
[CiSkippedTheory, BitAutoData] [CiSkippedTheory, BitAutoData]
public async void CreateAsync_Works_DataMatches( public async Task CreateAsync_Works_DataMatches(
Collection collection, Collection collection,
Organization organization, Organization organization,
CollectionCompare equalityComparer, CollectionCompare equalityComparer,

View File

@ -11,7 +11,7 @@ namespace Bit.Infrastructure.EFIntegration.Test.Repositories;
public class DeviceRepositoryTests public class DeviceRepositoryTests
{ {
[CiSkippedTheory, EfDeviceAutoData] [CiSkippedTheory, EfDeviceAutoData]
public async void CreateAsync_Works_DataMatches(Device device, User user, public async Task CreateAsync_Works_DataMatches(Device device, User user,
DeviceCompare equalityComparer, List<EfRepo.DeviceRepository> suts, DeviceCompare equalityComparer, List<EfRepo.DeviceRepository> suts,
List<EfRepo.UserRepository> efUserRepos, SqlRepo.DeviceRepository sqlDeviceRepo, List<EfRepo.UserRepository> efUserRepos, SqlRepo.DeviceRepository sqlDeviceRepo,
SqlRepo.UserRepository sqlUserRepo) SqlRepo.UserRepository sqlUserRepo)

View File

@ -11,7 +11,7 @@ namespace Bit.Infrastructure.EFIntegration.Test.Repositories;
public class InstallationRepositoryTests public class InstallationRepositoryTests
{ {
[CiSkippedTheory, EfInstallationAutoData] [CiSkippedTheory, EfInstallationAutoData]
public async void CreateAsync_Works_DataMatches( public async Task CreateAsync_Works_DataMatches(
Installation installation, Installation installation,
InstallationCompare equalityComparer, InstallationCompare equalityComparer,
List<EfRepo.InstallationRepository> suts, List<EfRepo.InstallationRepository> suts,

View File

@ -12,7 +12,7 @@ namespace Bit.Infrastructure.EFIntegration.Test.Repositories;
public class OrganizationSponsorshipRepositoryTests public class OrganizationSponsorshipRepositoryTests
{ {
[CiSkippedTheory, EfOrganizationSponsorshipAutoData] [CiSkippedTheory, EfOrganizationSponsorshipAutoData]
public async void CreateAsync_Works_DataMatches( public async Task CreateAsync_Works_DataMatches(
OrganizationSponsorship organizationSponsorship, Organization sponsoringOrg, OrganizationSponsorship organizationSponsorship, Organization sponsoringOrg,
List<EfRepo.OrganizationRepository> efOrgRepos, List<EfRepo.OrganizationRepository> efOrgRepos,
SqlRepo.OrganizationRepository sqlOrganizationRepo, SqlRepo.OrganizationRepository sqlOrganizationRepo,
@ -47,7 +47,7 @@ public class OrganizationSponsorshipRepositoryTests
} }
[CiSkippedTheory, EfOrganizationSponsorshipAutoData] [CiSkippedTheory, EfOrganizationSponsorshipAutoData]
public async void ReplaceAsync_Works_DataMatches(OrganizationSponsorship postOrganizationSponsorship, public async Task ReplaceAsync_Works_DataMatches(OrganizationSponsorship postOrganizationSponsorship,
OrganizationSponsorship replaceOrganizationSponsorship, Organization sponsoringOrg, OrganizationSponsorship replaceOrganizationSponsorship, Organization sponsoringOrg,
List<EfRepo.OrganizationRepository> efOrgRepos, List<EfRepo.OrganizationRepository> efOrgRepos,
SqlRepo.OrganizationRepository sqlOrganizationRepo, SqlRepo.OrganizationRepository sqlOrganizationRepo,
@ -89,7 +89,7 @@ public class OrganizationSponsorshipRepositoryTests
} }
[CiSkippedTheory, EfOrganizationSponsorshipAutoData] [CiSkippedTheory, EfOrganizationSponsorshipAutoData]
public async void DeleteAsync_Works_DataMatches(OrganizationSponsorship organizationSponsorship, public async Task DeleteAsync_Works_DataMatches(OrganizationSponsorship organizationSponsorship,
Organization sponsoringOrg, Organization sponsoringOrg,
List<EfRepo.OrganizationRepository> efOrgRepos, List<EfRepo.OrganizationRepository> efOrgRepos,
SqlRepo.OrganizationRepository sqlOrganizationRepo, SqlRepo.OrganizationRepository sqlOrganizationRepo,

View File

@ -11,7 +11,7 @@ namespace Bit.Infrastructure.EFIntegration.Test.Repositories;
public class TaxRateRepositoryTests public class TaxRateRepositoryTests
{ {
[CiSkippedTheory, EfTaxRateAutoData] [CiSkippedTheory, EfTaxRateAutoData]
public async void CreateAsync_Works_DataMatches( public async Task CreateAsync_Works_DataMatches(
TaxRate taxRate, TaxRate taxRate,
TaxRateCompare equalityComparer, TaxRateCompare equalityComparer,
List<EfRepo.TaxRateRepository> suts, List<EfRepo.TaxRateRepository> suts,

View File

@ -13,7 +13,7 @@ public class TransactionRepositoryTests
{ {
[CiSkippedTheory, EfUserTransactionAutoData, EfOrganizationTransactionAutoData] [CiSkippedTheory, EfUserTransactionAutoData, EfOrganizationTransactionAutoData]
public async void CreateAsync_Works_DataMatches( public async Task CreateAsync_Works_DataMatches(
Transaction transaction, Transaction transaction,
User user, User user,
Organization org, Organization org,

View File

@ -15,7 +15,7 @@ namespace Bit.Infrastructure.EFIntegration.Test.Repositories;
public class UserRepositoryTests public class UserRepositoryTests
{ {
[CiSkippedTheory, EfUserAutoData] [CiSkippedTheory, EfUserAutoData]
public async void CreateAsync_Works_DataMatches( public async Task CreateAsync_Works_DataMatches(
User user, UserCompare equalityComparer, User user, UserCompare equalityComparer,
List<EfRepo.UserRepository> suts, List<EfRepo.UserRepository> suts,
SqlRepo.UserRepository sqlUserRepo SqlRepo.UserRepository sqlUserRepo
@ -41,7 +41,7 @@ public class UserRepositoryTests
} }
[CiSkippedTheory, EfUserAutoData] [CiSkippedTheory, EfUserAutoData]
public async void ReplaceAsync_Works_DataMatches(User postUser, User replaceUser, public async Task ReplaceAsync_Works_DataMatches(User postUser, User replaceUser,
UserCompare equalityComparer, List<EfRepo.UserRepository> suts, UserCompare equalityComparer, List<EfRepo.UserRepository> suts,
SqlRepo.UserRepository sqlUserRepo) SqlRepo.UserRepository sqlUserRepo)
{ {
@ -65,7 +65,7 @@ public class UserRepositoryTests
} }
[CiSkippedTheory, EfUserAutoData] [CiSkippedTheory, EfUserAutoData]
public async void DeleteAsync_Works_DataMatches(User user, List<EfRepo.UserRepository> suts, SqlRepo.UserRepository sqlUserRepo) public async Task DeleteAsync_Works_DataMatches(User user, List<EfRepo.UserRepository> suts, SqlRepo.UserRepository sqlUserRepo)
{ {
foreach (var sut in suts) foreach (var sut in suts)
{ {
@ -93,7 +93,7 @@ public class UserRepositoryTests
} }
[CiSkippedTheory, EfUserAutoData] [CiSkippedTheory, EfUserAutoData]
public async void GetByEmailAsync_Works_DataMatches(User user, UserCompare equalityComparer, public async Task GetByEmailAsync_Works_DataMatches(User user, UserCompare equalityComparer,
List<EfRepo.UserRepository> suts, SqlRepo.UserRepository sqlUserRepo) List<EfRepo.UserRepository> suts, SqlRepo.UserRepository sqlUserRepo)
{ {
var savedUsers = new List<User>(); var savedUsers = new List<User>();
@ -113,7 +113,7 @@ public class UserRepositoryTests
} }
[CiSkippedTheory, EfUserAutoData] [CiSkippedTheory, EfUserAutoData]
public async void GetKdfInformationByEmailAsync_Works_DataMatches(User user, public async Task GetKdfInformationByEmailAsync_Works_DataMatches(User user,
UserKdfInformationCompare equalityComparer, List<EfRepo.UserRepository> suts, UserKdfInformationCompare equalityComparer, List<EfRepo.UserRepository> suts,
SqlRepo.UserRepository sqlUserRepo) SqlRepo.UserRepository sqlUserRepo)
{ {
@ -135,7 +135,7 @@ public class UserRepositoryTests
} }
[CiSkippedTheory, EfUserAutoData] [CiSkippedTheory, EfUserAutoData]
public async void SearchAsync_Works_DataMatches(User user, int skip, int take, public async Task SearchAsync_Works_DataMatches(User user, int skip, int take,
UserCompare equalityCompare, List<EfRepo.UserRepository> suts, UserCompare equalityCompare, List<EfRepo.UserRepository> suts,
SqlRepo.UserRepository sqlUserRepo) SqlRepo.UserRepository sqlUserRepo)
{ {
@ -157,7 +157,7 @@ public class UserRepositoryTests
} }
[CiSkippedTheory, EfUserAutoData] [CiSkippedTheory, EfUserAutoData]
public async void GetManyByPremiumAsync_Works_DataMatches(User user, public async Task GetManyByPremiumAsync_Works_DataMatches(User user,
List<EfRepo.UserRepository> suts, SqlRepo.UserRepository sqlUserRepo) List<EfRepo.UserRepository> suts, SqlRepo.UserRepository sqlUserRepo)
{ {
var returnedUsers = new List<User>(); var returnedUsers = new List<User>();
@ -178,7 +178,7 @@ public class UserRepositoryTests
} }
[CiSkippedTheory, EfUserAutoData] [CiSkippedTheory, EfUserAutoData]
public async void GetPublicKeyAsync_Works_DataMatches(User user, List<EfRepo.UserRepository> suts, public async Task GetPublicKeyAsync_Works_DataMatches(User user, List<EfRepo.UserRepository> suts,
SqlRepo.UserRepository sqlUserRepo) SqlRepo.UserRepository sqlUserRepo)
{ {
var returnedKeys = new List<string>(); var returnedKeys = new List<string>();
@ -199,7 +199,7 @@ public class UserRepositoryTests
} }
[CiSkippedTheory, EfUserAutoData] [CiSkippedTheory, EfUserAutoData]
public async void GetAccountRevisionDateAsync(User user, List<EfRepo.UserRepository> suts, public async Task GetAccountRevisionDateAsync(User user, List<EfRepo.UserRepository> suts,
SqlRepo.UserRepository sqlUserRepo) SqlRepo.UserRepository sqlUserRepo)
{ {
var returnedKeys = new List<string>(); var returnedKeys = new List<string>();
@ -220,7 +220,7 @@ public class UserRepositoryTests
} }
[CiSkippedTheory, EfUserAutoData] [CiSkippedTheory, EfUserAutoData]
public async void UpdateRenewalReminderDateAsync_Works_DataMatches(User user, public async Task UpdateRenewalReminderDateAsync_Works_DataMatches(User user,
DateTime updatedReminderDate, List<EfRepo.UserRepository> suts, DateTime updatedReminderDate, List<EfRepo.UserRepository> suts,
SqlRepo.UserRepository sqlUserRepo) SqlRepo.UserRepository sqlUserRepo)
{ {
@ -249,7 +249,7 @@ public class UserRepositoryTests
} }
[CiSkippedTheory, EfUserAutoData] [CiSkippedTheory, EfUserAutoData]
public async void GetBySsoUserAsync_Works_DataMatches(User user, Organization org, public async Task GetBySsoUserAsync_Works_DataMatches(User user, Organization org,
SsoUser ssoUser, UserCompare equalityComparer, List<EfRepo.UserRepository> suts, SsoUser ssoUser, UserCompare equalityComparer, List<EfRepo.UserRepository> suts,
List<EfRepo.SsoUserRepository> ssoUserRepos, List<EfRepo.OrganizationRepository> orgRepos, List<EfRepo.SsoUserRepository> ssoUserRepos, List<EfRepo.OrganizationRepository> orgRepos,
SqlRepo.UserRepository sqlUserRepo, SqlAuthRepo.SsoUserRepository sqlSsoUserRepo, SqlRepo.UserRepository sqlUserRepo, SqlAuthRepo.SsoUserRepository sqlSsoUserRepo,

View File

@ -15,7 +15,7 @@ namespace Bit.Infrastructure.EFIntegration.Test.Tools.Repositories;
public class SendRepositoryTests public class SendRepositoryTests
{ {
[CiSkippedTheory, EfUserSendAutoData, EfOrganizationSendAutoData] [CiSkippedTheory, EfUserSendAutoData, EfOrganizationSendAutoData]
public async void CreateAsync_Works_DataMatches( public async Task CreateAsync_Works_DataMatches(
Send send, Send send,
User user, User user,
Organization org, Organization org,

View File

@ -19,7 +19,7 @@ namespace Bit.Infrastructure.EFIntegration.Test.Repositories;
public class CipherRepositoryTests public class CipherRepositoryTests
{ {
[Theory(Skip = "Run ad-hoc"), EfUserCipherCustomize, BitAutoData] [Theory(Skip = "Run ad-hoc"), EfUserCipherCustomize, BitAutoData]
public async void RefreshDb(List<EfVaultRepo.CipherRepository> suts) public async Task RefreshDb(List<EfVaultRepo.CipherRepository> suts)
{ {
foreach (var sut in suts) foreach (var sut in suts)
{ {
@ -87,7 +87,7 @@ public class CipherRepositoryTests
} }
[CiSkippedTheory, EfUserCipherCustomize, BitAutoData] [CiSkippedTheory, EfUserCipherCustomize, BitAutoData]
public async void CreateAsync_BumpsUserAccountRevisionDate(Cipher cipher, User user, List<EfVaultRepo.CipherRepository> suts, List<EfRepo.UserRepository> efUserRepos) public async Task CreateAsync_BumpsUserAccountRevisionDate(Cipher cipher, User user, List<EfVaultRepo.CipherRepository> suts, List<EfRepo.UserRepository> efUserRepos)
{ {
var bumpedUsers = new List<User>(); var bumpedUsers = new List<User>();
foreach (var sut in suts) foreach (var sut in suts)
@ -110,7 +110,7 @@ public class CipherRepositoryTests
} }
[CiSkippedTheory, EfOrganizationCipherCustomize, BitAutoData] [CiSkippedTheory, EfOrganizationCipherCustomize, BitAutoData]
public async void CreateAsync_BumpsOrgUserAccountRevisionDates(Cipher cipher, List<User> users, public async Task CreateAsync_BumpsOrgUserAccountRevisionDates(Cipher cipher, List<User> users,
List<OrganizationUser> orgUsers, Collection collection, Organization org, List<EfVaultRepo.CipherRepository> suts, List<EfRepo.UserRepository> efUserRepos, List<EfRepo.OrganizationRepository> efOrgRepos, List<OrganizationUser> orgUsers, Collection collection, Organization org, List<EfVaultRepo.CipherRepository> suts, List<EfRepo.UserRepository> efUserRepos, List<EfRepo.OrganizationRepository> efOrgRepos,
List<EfRepo.OrganizationUserRepository> efOrgUserRepos, List<EfRepo.CollectionRepository> efCollectionRepos) List<EfRepo.OrganizationUserRepository> efOrgUserRepos, List<EfRepo.CollectionRepository> efCollectionRepos)
{ {

View File

@ -14,7 +14,7 @@ namespace Bit.Infrastructure.EFIntegration.Test.Repositories;
public class FolderRepositoryTests public class FolderRepositoryTests
{ {
[CiSkippedTheory, EfFolderAutoData] [CiSkippedTheory, EfFolderAutoData]
public async void CreateAsync_Works_DataMatches( public async Task CreateAsync_Works_DataMatches(
Folder folder, Folder folder,
User user, User user,
FolderCompare equalityComparer, FolderCompare equalityComparer,