Skip to content

Examples#89

Merged
JakeGinnivan merged 139 commits intomasterfrom
examples
May 5, 2014
Merged

Examples#89
JakeGinnivan merged 139 commits intomasterfrom
examples

Conversation

@JakeGinnivan
Copy link
Member

Fixes #15

Outstanding work:

  • Clean up, fix and improve NetToString logic
  • Overload for WithExamples with tabular verbatim string example?
  • Allow for multi-word examples
  • Reflective API
  • In reflective API the examples should be injected into properties
  • Allow injection into private and protected fields and properties (for both APIs)
  • Fluent API
  • Html Report
  • Metro Html Report
  • Markdown Report (PR Open)
  • Console Report
  • Diagnostics Report
  • Tests!
  • More samples of using Example API to the Samples project
  • Fluent Should replace example args in step. i.e GivenTheForceIs(ForceLevel) should have step name of Given the force level is <force level> if there is an example with Header of Force Level
  • Related, if the property is passed, I should not need a placeholder, i.e GivenTheForceIs__ForceLevel__
  • Throw error if we cannot find anywhere to put example value. It should go somewhere, otherwise small mispellings will be hard to find
  • ExecutableAttributeStepScanner does not look like it works with examples?
  • Allow assertion steps to all execute when grouped together (PR Open)

@JakeGinnivan JakeGinnivan added this to the V4 milestone Apr 5, 2014
@MehdiK
Copy link
Member

MehdiK commented Apr 5, 2014

Thanks for creating this here @JakeGinnivan.

FWIW this is a spike with a fair bit of ugly code and hack and pretty much no test coverage.

@JakeGinnivan
Copy link
Member Author

That is fine, we can keep going forward adding tests and cleaning it up.

We can just submit small PR's targeting this branch to keep reviewing changes small, and that way we can add tasks to the PR and anyone can jump in and take a small part

@JakeGinnivan
Copy link
Member Author

If we learn stuff, and want to start again instead, we can kill this and bring up another PR

@JakeGinnivan
Copy link
Member Author

Actually, is not an issue. I think it is just the test runner picking it up from multiple places

@JakeGinnivan
Copy link
Member Author

@MehdiK so the ExecutableAttributeStepScanner I was talking about is when you use RunStepWithArgsAttribute and examples together, it will not work.

Not sure how to fix this one, I would like to leave it to you or @mwhelan :P

@JakeGinnivan
Copy link
Member Author

I also think we have backfilled a lot of tests, I am not sure of any test cases to add (as I have found issues I have added tests).

I think basically the changes to the executable step scanner, and updating the diagnostics report is all we have to do.

Thoughts @MehdiK @mwhelan @robdmoore ?

If anyone has time to give this stuff a spin to try and find issues that would be awesome..

@MehdiK
Copy link
Member

MehdiK commented May 4, 2014

Thanks for finding it. Hmmm, it's a funny combination, ay? Will check it out.

@JakeGinnivan
Copy link
Member Author

@MehdiK I'm not sure it is even a valid combination. But at a minimum if the attribute exists, throw an exception saying to report your scenario? :)

@JakeGinnivan
Copy link
Member Author

But to make a test fail, do this to ReflectiveWithExamples

    -public void GivenStepWith__FirstExample__PassedAsParameter(int firstExample)
    +[RunStepWithArgs("input string")]
    +public void GivenStepWith__FirstExample__PassedAsParameter(int firstExample, string input)
    {
        firstExample.ShouldBeOneOf(1, 2);
        +input.ShouldBe("input string");
    }

@MehdiK
Copy link
Member

MehdiK commented May 4, 2014

That definitely not going to work; but I was thinking about a potential valid combination of RunStepWithArgs on a reflective step method without example argument(s) so the two would rather complement each other.

@MehdiK
Copy link
Member

MehdiK commented May 4, 2014

Agreed about the exception on invalid combination.

JakeGinnivan added a commit that referenced this pull request May 5, 2014
@JakeGinnivan JakeGinnivan merged commit 7ac863f into master May 5, 2014
@JakeGinnivan JakeGinnivan deleted the examples branch May 5, 2014 15:29
@MehdiK
Copy link
Member

MehdiK commented May 5, 2014

OH YEEEEEEEEAAAAAAAH!!

Thanks mate for the awesome work on this PR.

This was referenced May 5, 2014
@isaldarriaga
Copy link

When using the Metro style, example table is not displayed in the report.

// to change to metro style
Configurator.BatchProcessors.HtmlMetroReport.Enable();

@JakeGinnivan
Copy link
Member Author

@isaldarriaga can you open a fresh issue?

@isaldarriaga
Copy link

Sure

#210

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for table-based examples

6 participants