2

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

5
  • are these your methods? Commented Mar 24 at 20:52
  • @DaveCousineau The problem causes in methods, that`s contains entity customization for AutoFixture - both requires Fixture entity and apply customization via CompositeCustomization Commented Mar 24 at 22:00
  • Ok but I don't know what they are. Are they from a library or are they your methods? Is BLLExtensions yours? So far when I've tried googling what they are all I find is this post. If they are yours then it would depend exactly what they are doing. Commented Mar 24 at 22:13
  • @DaveCousineau They are my methods, and what all they doing - is just defines a customization for AutoFixture. For example, in one of the customization methods i setted up how much data i need in lists, what types should be generated and what is the "deph of the define" (To prevent looping while creating dummy data if two entities has an object of each other) Commented Mar 24 at 22:35
  • What is the problem with these methods? Aren't they working? You want to rewrite them? If so, please share their code. Commented Mar 25 at 12:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.