mirror of
https://github.com/bitwarden/server.git
synced 2024-11-25 12:45:18 +01:00
231eb84e69
* Turn on ImplicitUsings * Fix formatting * Run linter
47 lines
1.5 KiB
C#
47 lines
1.5 KiB
C#
using Bit.Core.Entities;
|
|
using Bit.Core.Enums;
|
|
using Bit.Core.Identity;
|
|
using Bit.Test.Common.AutoFixture;
|
|
using Bit.Test.Common.AutoFixture.Attributes;
|
|
using Xunit;
|
|
|
|
namespace Bit.Core.Test.Identity
|
|
{
|
|
public class EmailTokenProviderTests : BaseTokenProviderTests<EmailTokenProvider>
|
|
{
|
|
public override TwoFactorProviderType TwoFactorProviderType => TwoFactorProviderType.Email;
|
|
|
|
public static IEnumerable<object[]> CanGenerateTwoFactorTokenAsyncData
|
|
=> SetupCanGenerateData(
|
|
(
|
|
new Dictionary<string, object>
|
|
{
|
|
["Email"] = "test@email.com",
|
|
},
|
|
true
|
|
),
|
|
(
|
|
new Dictionary<string, object>
|
|
{
|
|
["NotEmail"] = "value",
|
|
},
|
|
false
|
|
),
|
|
(
|
|
new Dictionary<string, object>
|
|
{
|
|
["Email"] = "",
|
|
},
|
|
false
|
|
)
|
|
);
|
|
|
|
[Theory, BitMemberAutoData(nameof(CanGenerateTwoFactorTokenAsyncData))]
|
|
public override async Task RunCanGenerateTwoFactorTokenAsync(Dictionary<string, object> metaData, bool expectedResponse,
|
|
User user, SutProvider<EmailTokenProvider> sutProvider)
|
|
{
|
|
await base.RunCanGenerateTwoFactorTokenAsync(metaData, expectedResponse, user, sutProvider);
|
|
}
|
|
}
|
|
}
|