using IdentityShroud.Core.Contracts; using IdentityShroud.Core.Security; namespace IdentityShroud.TestUtils.Substitutes; public static class EncryptionServiceSubstitute { public static KekId KeyId { get; } = KekId.NewId(); public static IDekEncryptionService CreatePassthrough() { var encryptionService = Substitute.For(); encryptionService .Encrypt(Arg.Any>()) .Returns(x => new EncryptedDek(KeyId, x.ArgAt>(0).ToArray())); encryptionService .Decrypt(Arg.Any()) .Returns(x => x.ArgAt(0).Value); return encryptionService; } }