2023-01-13 15:02:53 +01:00
|
|
|
|
using AutoFixture;
|
2023-01-24 19:57:28 +01:00
|
|
|
|
using Bit.Core.SecretsManager.Entities;
|
2023-01-13 15:02:53 +01:00
|
|
|
|
using Bit.Test.Common.AutoFixture.Attributes;
|
|
|
|
|
|
2023-01-24 19:57:28 +01:00
|
|
|
|
namespace Bit.Core.Test.SecretsManager.AutoFixture.SecretsFixture;
|
2023-01-13 15:02:53 +01:00
|
|
|
|
|
|
|
|
|
public class SecretCustomization : ICustomization
|
|
|
|
|
{
|
|
|
|
|
public void Customize(IFixture fixture)
|
|
|
|
|
{
|
|
|
|
|
var secretId = Guid.NewGuid();
|
|
|
|
|
|
|
|
|
|
fixture.Customize<Secret>(composer => composer
|
|
|
|
|
.With(o => o.Id, secretId)
|
|
|
|
|
.Without(s => s.Projects));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class SecretCustomizeAttribute : BitCustomizeAttribute
|
|
|
|
|
{
|
|
|
|
|
public override ICustomization GetCustomization() => new SecretCustomization();
|
|
|
|
|
}
|