This test passes, but as you can see it's massive because of the complexity of what the class has to do.
28 lines
770 B
C#
28 lines
770 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using AutoFixture.Kernel;
|
|
using Elsa.Bookmarks;
|
|
using Moq;
|
|
|
|
namespace Elsa.Testing.Shared.AutoFixture.SpecimenBuilders
|
|
{
|
|
public class MockBookmarkProvidersSpecimenBuilder : ISpecimenBuilder
|
|
{
|
|
readonly int howMany;
|
|
|
|
public object Create(object request, ISpecimenContext context)
|
|
{
|
|
if (!request.IsAnAutofixtureRequestForType<IEnumerable<IBookmarkProvider>>())
|
|
return new NoSpecimen();
|
|
|
|
return Enumerable.Range(0, howMany)
|
|
.Select(x => Mock.Of<IBookmarkProvider>())
|
|
.ToList();
|
|
}
|
|
|
|
public MockBookmarkProvidersSpecimenBuilder(int howMany)
|
|
{
|
|
this.howMany = howMany;
|
|
}
|
|
}
|
|
} |