Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve fake creation options interaction #467

Closed
blairconrad opened this issue Mar 9, 2015 · 1 comment · Fixed by #487
Closed

improve fake creation options interaction #467

blairconrad opened this issue Mar 9, 2015 · 1 comment · Fixed by #487

Comments

@blairconrad
Copy link
Member

spun off from/a precursor to #461, specifically #461 (comment), where I advocate this set of interactions:

  • CallsBaseMethods - should trump prior invocations of ConfigureFake, Strict, and Wrapping
  • ConfigureFake - should "stack" with prior invocations, just as
    multiple A.CallsTo do, which would include overriding earlier
    CallsBaseMethods, Strict, and Wrapping
  • Implements - should "stack" with prior invocations, ever accumulating more interfaces
  • Strict - should trump prior invocations of CallsBaseMethods,
    ConfigureFake, and Wrapping
  • WithAdditionalAttributes - should "stack" with prior invocations, ever accumulating more attributes
  • WithArgumentsForConstructor - should trump prior invocations
  • Wrapping - should trump prior invocations of CallsBaseMethods,
    ConfigureFake, Strict, and Wrapping

While writing characterization tests in #465, I noticed deviations, even when just setting competing options in the A.Fake() calls:

  • WithAdditionalAttributes called twice: last one in wins, rather than stacking
  • ConfigureFake followed by Wrapping - uses configured, not wrapped, behaviour
  • CallsBaseMethods followed by Wrapping - calls base method
  • Strict followed by Wrapping - acts strict

I'd like to smooth out these deviations before extending IFakeConfigurator.

I am very close to a PR (in the "cleanup" phase) that would build upon the work in #465.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants