mirror of
https://github.com/bitwarden/server.git
synced 2024-12-11 15:17:44 +01:00
231eb84e69
* Turn on ImplicitUsings * Fix formatting * Run linter
24 lines
879 B
C#
24 lines
879 B
C#
using Bit.Core.Entities;
|
|
using Bit.Core.OrganizationFeatures.OrganizationApiKeys;
|
|
using Bit.Test.Common.AutoFixture;
|
|
using Bit.Test.Common.AutoFixture.Attributes;
|
|
using Bit.Test.Common.Helpers;
|
|
using Xunit;
|
|
|
|
namespace Bit.Core.Test.OrganizationFeatures.OrganizationApiKeys
|
|
{
|
|
[SutProviderCustomize]
|
|
public class RotateOrganizationApiKeyCommandTests
|
|
{
|
|
[Theory, BitAutoData]
|
|
public async Task RotateApiKeyAsync_RotatesKey(SutProvider<RotateOrganizationApiKeyCommand> sutProvider,
|
|
OrganizationApiKey organizationApiKey)
|
|
{
|
|
var existingKey = organizationApiKey.ApiKey;
|
|
organizationApiKey = await sutProvider.Sut.RotateApiKeyAsync(organizationApiKey);
|
|
Assert.NotEqual(existingKey, organizationApiKey.ApiKey);
|
|
AssertHelper.AssertRecent(organizationApiKey.RevisionDate);
|
|
}
|
|
}
|
|
}
|