using Bit.Core.Auth.Enums; using Bit.Core.Auth.Identity; using Bit.Core.Entities; using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture.Attributes; using Xunit; namespace Bit.Core.Test.Auth.Identity; public class EmailTwoFactorTokenProviderTests : BaseTokenProviderTests { public override TwoFactorProviderType TwoFactorProviderType => TwoFactorProviderType.Email; public static IEnumerable CanGenerateTwoFactorTokenAsyncData => SetupCanGenerateData( ( new Dictionary { ["Email"] = "test@email.com", }, true ), ( new Dictionary { ["NotEmail"] = "value", }, false ), ( new Dictionary { ["Email"] = "", }, false ) ); [Theory, BitMemberAutoData(nameof(CanGenerateTwoFactorTokenAsyncData))] public override async Task RunCanGenerateTwoFactorTokenAsync(Dictionary metaData, bool expectedResponse, User user, SutProvider sutProvider) { await base.RunCanGenerateTwoFactorTokenAsync(metaData, expectedResponse, user, sutProvider); } }