最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - Is there any a.k.a. CompositeCustomization, but for IFIxture - Stack Overflow

programmeradmin10浏览0评论

I have next Fixture configuration code:

private static IFixture CreateFixture()
{
    var fixture = new Fixture();

    fixture.Behaviors.OfType<ThrowingRecursionBehavior>().ToList()
        .ForEach(b => fixture.Behaviors.Remove(b));
    fixture.Behaviors.Add(new OmitOnRecursionBehavior());

    BLLExtensions.FixtureExtensions.ApplyProjectCustomizations(fixture);
    WebExtensions.FixtureExtensions.ApplyProjectCustomizations(fixture);

    return fixture;
}

The problem causes here:

BLLExtensions.FixtureExtensions.ApplyProjectCustomizations(fixture);
WebExtensions.FixtureExtensions.ApplyProjectCustomizations(fixture);

Both methods requires IFixture and just rewrites each other. I want to know, is there any possible solution of this problem, for example CompositeCustomization method, but for Fixture entity

发布评论

评论列表(0)

  1. 暂无评论