mirror of
https://github.com/bitwarden/server
synced 2026-01-01 08:03:23 +00:00
XUnit.v3 Upgrade
This commit is contained in:
@@ -213,7 +213,7 @@ public class OrganizationUserControllerTests : IClassFixture<ApiApplicationFacto
|
||||
Assert.Equal(HttpStatusCode.Forbidden, httpResponse.StatusCode);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
_ownerEmail = $"org-user-integration-test-{Guid.NewGuid()}@bitwarden.com";
|
||||
await _factory.LoginWithNewAccount(_ownerEmail);
|
||||
@@ -325,10 +325,10 @@ public class OrganizationUserControllerTests : IClassFixture<ApiApplicationFacto
|
||||
await VerifyCollectionAccessWasUpdatedCorrectlyAsync(organizationUser, sharedCollection.Id, defaultCollection.Id);
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task<(Group group, Collection sharedCollection, Collection defaultCollection)> CreateTestDataAsync()
|
||||
|
||||
@@ -3,7 +3,6 @@ using System.Net.Http.Headers;
|
||||
using Bit.Api.IntegrationTest.Factories;
|
||||
using Bit.Seeder.Recipes;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace Bit.Api.IntegrationTest.AdminConsole.Controllers;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public class OrganizationUsersControllerPutResetPasswordTests : IClassFixture<Ap
|
||||
_loginHelper = new LoginHelper(_factory, _client);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
_ownerEmail = $"reset-password-test-{Guid.NewGuid()}@example.com";
|
||||
await _factory.LoginWithNewAccount(_ownerEmail);
|
||||
@@ -67,10 +67,10 @@ public class OrganizationUsersControllerPutResetPasswordTests : IClassFixture<Ap
|
||||
});
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -39,7 +39,7 @@ public class PoliciesControllerTests : IClassFixture<ApiApplicationFactory>, IAs
|
||||
_loginHelper = new LoginHelper(_factory, _client);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
_ownerEmail = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
await _factory.LoginWithNewAccount(_ownerEmail);
|
||||
@@ -50,10 +50,10 @@ public class PoliciesControllerTests : IClassFixture<ApiApplicationFactory>, IAs
|
||||
await _loginHelper.LoginAsync(_ownerEmail);
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ImportOrganizationUsersAndGroupsCommandTests : IClassFixture<ApiApp
|
||||
_loginHelper = new LoginHelper(_factory, _client);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
// Create the owner account
|
||||
_ownerEmail = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
@@ -40,10 +40,10 @@ public class ImportOrganizationUsersAndGroupsCommandTests : IClassFixture<ApiApp
|
||||
await _loginHelper.LoginWithOrganizationApiKeyAsync(_organization.Id);
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -32,7 +32,7 @@ public class MembersControllerTests : IClassFixture<ApiApplicationFactory>, IAsy
|
||||
_loginHelper = new LoginHelper(_factory, _client);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
// Create the owner account
|
||||
_ownerEmail = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
@@ -46,10 +46,10 @@ public class MembersControllerTests : IClassFixture<ApiApplicationFactory>, IAsy
|
||||
await _loginHelper.LoginWithOrganizationApiKeyAsync(_organization.Id);
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -32,7 +32,7 @@ public class PoliciesControllerTests : IClassFixture<ApiApplicationFactory>, IAs
|
||||
_loginHelper = new LoginHelper(_factory, _client);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
// Create the owner account
|
||||
_ownerEmail = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
@@ -46,10 +46,10 @@ public class PoliciesControllerTests : IClassFixture<ApiApplicationFactory>, IAs
|
||||
await _loginHelper.LoginWithOrganizationApiKeyAsync(_organization.Id);
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -4,12 +4,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNetTestSdkVersion)" />
|
||||
<PackageReference Include="xunit" Version="$(XUnitVersion)" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="$(XUnitRunnerVisualStudioVersion)">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="xunit.v3" Version="$(XUnitv3Version)" />
|
||||
<PackageReference Include="coverlet.collector" Version="$(CoverletCollectorVersion)">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
|
||||
@@ -51,16 +51,16 @@ public class AccountsControllerTest : IClassFixture<ApiApplicationFactory>, IAsy
|
||||
_passwordHasher = _factory.GetService<IPasswordHasher<User>>();
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
_ownerEmail = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
await _factory.LoginWithNewAccount(_ownerEmail);
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -21,7 +21,7 @@ public class ConfigControllerTests : IClassFixture<ApiApplicationFactory>, IAsyn
|
||||
_client = _factory.CreateClient();
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
_email = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
|
||||
@@ -29,10 +29,10 @@ public class ConfigControllerTests : IClassFixture<ApiApplicationFactory>, IAsyn
|
||||
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokens.Token);
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task LoginAsync()
|
||||
|
||||
@@ -58,16 +58,16 @@ public class AccountsKeyManagementControllerTests : IClassFixture<ApiApplication
|
||||
_userSignatureKeyPairRepository = _factory.GetService<IUserSignatureKeyPairRepository>();
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
_ownerEmail = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
await _factory.LoginWithNewAccount(_ownerEmail);
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
@@ -49,7 +49,7 @@ public class NotificationsControllerTests : IClassFixture<ApiApplicationFactory>
|
||||
_userRepository = _factory.GetService<IUserRepository>();
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
// Create the owner account
|
||||
_ownerEmail = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
@@ -63,7 +63,7 @@ public class NotificationsControllerTests : IClassFixture<ApiApplicationFactory>
|
||||
_notificationsWithStatuses = await CreateNotificationsWithStatusesAsync();
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
|
||||
@@ -72,7 +72,7 @@ public class NotificationsControllerTests : IClassFixture<ApiApplicationFactory>
|
||||
_notificationRepository.DeleteAsync(notification);
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -220,7 +220,7 @@ public class NotificationsControllerTests : IClassFixture<ApiApplicationFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
private async void MarkAsDeletedAsync_NotLoggedIn_Unauthorized()
|
||||
private async Task MarkAsDeletedAsync_NotLoggedIn_Unauthorized()
|
||||
{
|
||||
var url = $"/notifications/{Guid.NewGuid().ToString()}/delete";
|
||||
var response = await _client.PatchAsync(url, new StringContent(""));
|
||||
@@ -228,7 +228,7 @@ public class NotificationsControllerTests : IClassFixture<ApiApplicationFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
private async void MarkAsDeletedAsync_NonExistentNotificationId_NotFound()
|
||||
private async Task MarkAsDeletedAsync_NonExistentNotificationId_NotFound()
|
||||
{
|
||||
await _loginHelper.LoginAsync(_ownerEmail);
|
||||
|
||||
@@ -238,7 +238,7 @@ public class NotificationsControllerTests : IClassFixture<ApiApplicationFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
private async void MarkAsDeletedAsync_UserIdNotMatching_NotFound()
|
||||
private async Task MarkAsDeletedAsync_UserIdNotMatching_NotFound()
|
||||
{
|
||||
var email = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
await _factory.LoginWithNewAccount(email);
|
||||
@@ -253,7 +253,7 @@ public class NotificationsControllerTests : IClassFixture<ApiApplicationFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
private async void MarkAsDeletedAsync_OrganizationIdNotMatchingUserNotPartOfOrganization_NotFound()
|
||||
private async Task MarkAsDeletedAsync_OrganizationIdNotMatchingUserNotPartOfOrganization_NotFound()
|
||||
{
|
||||
var email = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
await _factory.LoginWithNewAccount(email);
|
||||
@@ -268,7 +268,7 @@ public class NotificationsControllerTests : IClassFixture<ApiApplicationFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
private async void MarkAsDeletedAsync_OrganizationIdNotMatchingUserPartOfDifferentOrganization_NotFound()
|
||||
private async Task MarkAsDeletedAsync_OrganizationIdNotMatchingUserPartOfDifferentOrganization_NotFound()
|
||||
{
|
||||
var (organization, _) = await OrganizationTestHelpers.SignUpAsync(_factory,
|
||||
plan: PlanType.EnterpriseAnnually, ownerEmail: _ownerEmail, passwordManagerSeats: 10,
|
||||
@@ -287,7 +287,7 @@ public class NotificationsControllerTests : IClassFixture<ApiApplicationFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
private async void MarkAsDeletedAsync_NotificationStatusNotExisting_Created()
|
||||
private async Task MarkAsDeletedAsync_NotificationStatusNotExisting_Created()
|
||||
{
|
||||
var notifications = await CreateNotificationsAsync(_organizationUserOwner.UserId);
|
||||
|
||||
@@ -308,7 +308,7 @@ public class NotificationsControllerTests : IClassFixture<ApiApplicationFactory>
|
||||
[Theory]
|
||||
[InlineData(false)]
|
||||
[InlineData(true)]
|
||||
private async void MarkAsDeletedAsync_NotificationStatusExisting_Updated(bool deletedDateNull)
|
||||
private async Task MarkAsDeletedAsync_NotificationStatusExisting_Updated(bool deletedDateNull)
|
||||
{
|
||||
var notifications = await CreateNotificationsAsync(_organizationUserOwner.UserId);
|
||||
await _notificationStatusRepository.CreateAsync(new NotificationStatus
|
||||
@@ -334,7 +334,7 @@ public class NotificationsControllerTests : IClassFixture<ApiApplicationFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
private async void MarkAsReadAsync_NotLoggedIn_Unauthorized()
|
||||
private async Task MarkAsReadAsync_NotLoggedIn_Unauthorized()
|
||||
{
|
||||
var url = $"/notifications/{Guid.NewGuid().ToString()}/read";
|
||||
var response = await _client.PatchAsync(url, new StringContent(""));
|
||||
@@ -342,7 +342,7 @@ public class NotificationsControllerTests : IClassFixture<ApiApplicationFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
private async void MarkAsReadAsync_NonExistentNotificationId_NotFound()
|
||||
private async Task MarkAsReadAsync_NonExistentNotificationId_NotFound()
|
||||
{
|
||||
await _loginHelper.LoginAsync(_ownerEmail);
|
||||
|
||||
@@ -352,7 +352,7 @@ public class NotificationsControllerTests : IClassFixture<ApiApplicationFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
private async void MarkAsReadAsync_UserIdNotMatching_NotFound()
|
||||
private async Task MarkAsReadAsync_UserIdNotMatching_NotFound()
|
||||
{
|
||||
var email = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
await _factory.LoginWithNewAccount(email);
|
||||
@@ -367,7 +367,7 @@ public class NotificationsControllerTests : IClassFixture<ApiApplicationFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
private async void MarkAsReadAsync_OrganizationIdNotMatchingUserNotPartOfOrganization_NotFound()
|
||||
private async Task MarkAsReadAsync_OrganizationIdNotMatchingUserNotPartOfOrganization_NotFound()
|
||||
{
|
||||
var email = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
await _factory.LoginWithNewAccount(email);
|
||||
@@ -382,7 +382,7 @@ public class NotificationsControllerTests : IClassFixture<ApiApplicationFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
private async void MarkAsReadAsync_OrganizationIdNotMatchingUserPartOfDifferentOrganization_NotFound()
|
||||
private async Task MarkAsReadAsync_OrganizationIdNotMatchingUserPartOfDifferentOrganization_NotFound()
|
||||
{
|
||||
var (organization, _) = await OrganizationTestHelpers.SignUpAsync(_factory,
|
||||
plan: PlanType.EnterpriseAnnually, ownerEmail: _ownerEmail, passwordManagerSeats: 10,
|
||||
@@ -401,7 +401,7 @@ public class NotificationsControllerTests : IClassFixture<ApiApplicationFactory>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
private async void MarkAsReadAsync_NotificationStatusNotExisting_Created()
|
||||
private async Task MarkAsReadAsync_NotificationStatusNotExisting_Created()
|
||||
{
|
||||
var notifications = await CreateNotificationsAsync(_organizationUserOwner.UserId);
|
||||
|
||||
@@ -422,7 +422,7 @@ public class NotificationsControllerTests : IClassFixture<ApiApplicationFactory>
|
||||
[Theory]
|
||||
[InlineData(false)]
|
||||
[InlineData(true)]
|
||||
private async void MarkAsReadAsync_NotificationStatusExisting_Updated(bool readDateNull)
|
||||
private async Task MarkAsReadAsync_NotificationStatusExisting_Updated(bool readDateNull)
|
||||
{
|
||||
var notifications = await CreateNotificationsAsync(_organizationUserOwner.UserId);
|
||||
await _notificationStatusRepository.CreateAsync(new NotificationStatus
|
||||
|
||||
@@ -44,17 +44,17 @@ public class AccessPoliciesControllerTests : IClassFixture<ApiApplicationFactory
|
||||
_loginHelper = new LoginHelper(_factory, _client);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
_email = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
await _factory.LoginWithNewAccount(_email);
|
||||
_organizationHelper = new SecretsManagerOrganizationHelper(_factory, _email);
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
@@ -49,17 +49,17 @@ public class CountsControllerTests : IClassFixture<ApiApplicationFactory>, IAsyn
|
||||
}
|
||||
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
_email = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
await _factory.LoginWithNewAccount(_email);
|
||||
_organizationHelper = new SecretsManagerOrganizationHelper(_factory, _email);
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
@@ -37,17 +37,17 @@ public class ProjectsControllerTests : IClassFixture<ApiApplicationFactory>, IAs
|
||||
_loginHelper = new LoginHelper(_factory, _client);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
_email = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
await _factory.LoginWithNewAccount(_email);
|
||||
_organizationHelper = new SecretsManagerOrganizationHelper(_factory, _email);
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
@@ -41,17 +41,17 @@ public class SecretsControllerTests : IClassFixture<ApiApplicationFactory>, IAsy
|
||||
_loginHelper = new LoginHelper(_factory, _client);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
_email = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
await _factory.LoginWithNewAccount(_email);
|
||||
_organizationHelper = new SecretsManagerOrganizationHelper(_factory, _email);
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
@@ -28,17 +28,17 @@ public class SecretsManagerEventsControllerTests : IClassFixture<ApiApplicationF
|
||||
_serviceAccountRepository = _factory.GetService<IServiceAccountRepository>();
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
_email = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
await _factory.LoginWithNewAccount(_email);
|
||||
_organizationHelper = new SecretsManagerOrganizationHelper(_factory, _email);
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task LoginAsync(string email)
|
||||
|
||||
@@ -22,17 +22,17 @@ public class SecretsManagerPortingControllerTests : IClassFixture<ApiApplication
|
||||
_loginHelper = new LoginHelper(_factory, _client);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
_email = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
await _factory.LoginWithNewAccount(_email);
|
||||
_organizationHelper = new SecretsManagerOrganizationHelper(_factory, _email);
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
@@ -30,17 +30,17 @@ public class SecretsTrashControllerTests : IClassFixture<ApiApplicationFactory>,
|
||||
_loginHelper = new LoginHelper(_factory, _client);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
_email = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
await _factory.LoginWithNewAccount(_email);
|
||||
_organizationHelper = new SecretsManagerOrganizationHelper(_factory, _email);
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
@@ -48,17 +48,17 @@ public class ServiceAccountsControllerTests : IClassFixture<ApiApplicationFactor
|
||||
_loginHelper = new LoginHelper(_factory, _client);
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
_email = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
await _factory.LoginWithNewAccount(_email);
|
||||
_organizationHelper = new SecretsManagerOrganizationHelper(_factory, _email);
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
@@ -26,16 +26,16 @@ public class SyncControllerTests : IClassFixture<ApiApplicationFactory>, IAsyncL
|
||||
_userRepository = _factory.GetService<IUserRepository>();
|
||||
}
|
||||
|
||||
public async Task InitializeAsync()
|
||||
public async ValueTask InitializeAsync()
|
||||
{
|
||||
_ownerEmail = $"integration-test{Guid.NewGuid()}@bitwarden.com";
|
||||
await _factory.LoginWithNewAccount(_ownerEmail);
|
||||
}
|
||||
|
||||
public Task DisposeAsync()
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_client.Dispose();
|
||||
return Task.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user