You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
841 B
35 lines
841 B
#nullable enable |
|
using AutoFixture; |
|
using AutoFixture.Kernel; |
|
using Azure.Storage.Queues; |
|
using Bit.Test.Common.AutoFixture.Attributes; |
|
using NSubstitute; |
|
|
|
namespace Bit.Core.Test.AutoFixture; |
|
|
|
public class QueueClientBuilder : ISpecimenBuilder |
|
{ |
|
public object Create(object request, ISpecimenContext context) |
|
{ |
|
var type = request as Type; |
|
if (type == typeof(QueueClient)) |
|
{ |
|
return Substitute.For<QueueClient>(); |
|
} |
|
|
|
return new NoSpecimen(); |
|
} |
|
} |
|
|
|
public class QueueClientCustomizeAttribute : BitCustomizeAttribute |
|
{ |
|
public override ICustomization GetCustomization() => new QueueClientFixtures(); |
|
} |
|
|
|
public class QueueClientFixtures : ICustomization |
|
{ |
|
public void Customize(IFixture fixture) |
|
{ |
|
fixture.Customizations.Add(new QueueClientBuilder()); |
|
} |
|
}
|
|
|