Skip to content

Allow Expectation Naming in [Rock] #421

Description

@JasonBock

Describe the solution you'd like
If someone doesn't like the "{mockType}{Create/Make}{Expectations}" naming convention, but they don't want to use [RockPartial] for whatever reason, maybe another option would be to allow the name to be given in the attribute itself. Something like:

[Rock(typeof(ITarget), BuildType.Create, createName: "ITargetStuff")]

I'd add two optional parameters, createName and makeName, typed as string?. If they're null, I use the default Rocks naming convention.

Some other things to consider:

  • The name should not contain generic parameters. If the mock type is generic, this only affects the name of the expectations class, not the type parameters.
  • Should I continue to default using the namespace of the mock type, or allow the user to specify a namespace? That could get to be a little bit too much.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions