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

Basic comments handling #311

Merged
merged 13 commits into from
Apr 10, 2016
Merged

Conversation

ludwigjossieaux
Copy link

Hello,

Related to issue #271, please find a basic handling of the comments at step level.

Based on the location (line, column) provided by the parser, the comments above the steps are considered commenting the step below. There is some edge cases not yet taken into account (comments below the last step, for instance); if you agree with the basic principle, I can make sure these are also taken into account.

There are also few tests checking the feature is working for the output formats.

@dirkrombauts
Copy link
Member

Cool, I like it. I had a quick review of the code and I think the overall direction is good. So please go ahead and add handling for the edge cases you mentioned.

One concern - it's a bit of a mystery to me: the continuous build successfully built your pull request, but when I checked it out locally and ran the tests, two of them were failing. Both of them in the FormattingAFeature file. The reason is that the expected JSON did not include arrays for the comments. Could you check that in your version please!

And again, thanks for this big contribution. It would be cool if you could finalize it this week so it can be released in time for the CukeUP conference next week :-)

@ludwigjossieaux
Copy link
Author

Thanks for the feedback ! it's doable this week, I'll add the missing commits.

Concerning the two tests, you are right it is missing the comment arrays on the step object, it will be added with the next commits. However these tests were already failing with the fork I did (still the head revision on develop). It looks like the "Summary" object is missing between "Features" and "Configuration". Is it correct ?

@dirkrombauts
Copy link
Member

I fixed the failing tests (by removing the "configuration" line which was an overspecification of the test). It's a bit of a mystery why the test sometimes passes and sometimes fails. I have my suspicions but no proof :-/

Anyway, you can now pull the latest commit from picklesdoc/develop with the fixed test.

@ludwigjossieaux
Copy link
Author

Hi,
I've pushed the commits for the comments located after the last step of a scenario. I'm still not entirely sure how handle more freely placed comments (outside of steps). I've also added some more tests and fixed those not passing.
Let me know if you would think of something else I could add

// Set default
this.Type = CommentType.Normal;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line contains whitespace, please remove it

@@ -19,8 +19,11 @@
// --------------------------------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this unused using

@dirkrombauts
Copy link
Member

Thanks for your continuing efforts!

I added a bunch of codestyle-related remarks to the files.

I would also like you to write unit tests for the mapper, like the once you find in https://github.com/picklesdoc/pickles/tree/develop/src/Pickles/Pickles.Test/ObjectModel

@ludwigjossieaux
Copy link
Author

Hi, I've just finished the clean up + the test missing for the mapper, hopefully I didn't miss anything.

@dirkrombauts
Copy link
Member

So far so good - thanks!

I also meant really granular tests where you test the mapping of Comment and Location in isolation, like for example the steps class mapping is being tested in https://github.com/picklesdoc/pickles/blob/develop/src/Pickles/Pickles.Test/ObjectModel/MapperTestsForStep.cs.

@ludwigjossieaux
Copy link
Author

Ah alright, I've misunderstood the request, I've added two tests classes for comment and location, that should cover these cases

@dirkrombauts dirkrombauts merged commit ed7658e into picklesdoc:develop Apr 10, 2016
@dirkrombauts
Copy link
Member

Thanks for your time and energy!

dirkrombauts added a commit that referenced this pull request Apr 12, 2016
* Fix failing tests by removing overspecification

* Untabify

* Ensure description of feature is never null, fixes crashes of word and excel generation

* Unit test

* SpecFlow conformant name mapping 

* Implement name mapping in nunit signature builder more conformant to SpecFlows name generation logic wrt. to special characters

* Unit tests for special character handling

* Basic comments handling (#311)

* basic comment handling

* add excel handling

* cleanup

* clean up

* fix tests

* handle comments after the last step of a scenario

* clean up

* codestyle clean up

* codestyle clean up

* add test for mapper on comments

* clean up

* adding mapper tests on comments and location
+ more clean up

* Update Nuget packages (and small fixes) (#310)

* Update-Package SpecFlow

* Update-Package Nunit

* ExpectedException is obsolete in nunit3

* Update-Package System.IO.Abstractions.*

* Refactor CurrentScenarioContext to be instance-based and to be injected

* Update-Package MahApps.Metro

* Update-Package AutoMapper

* Update-Package Newtonsoft.Json

* Remove IKVM assembly binding redirects

* Do not use ScenarioContext.Current

* tweak gitignore

* Update GhostDoc file

* Downgrade Automapper to last known good version

* Exclude test project from test coverage

* Edit applicationhost.config

* Added support for multiple tags when searching (issue #283) (#319)

* Use Gherkin 4 parser (#322)

* Update-Package Gherkin

* tweak applicationhost.config

* Factory creates a GherkinDocument now

* The parser now returns a GherkinDocument

* Map a GherkinDocument to a Feature

* Use new icon (#323)

* Use new icon

* Use a big png file with the new logo

* Use the new .png file in the .nuspec files

* Use visual studio 2015

* Version bump to 2.6.0

* Update change log
@dirkrombauts
Copy link
Member

Released in version 2.6.0

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

Successfully merging this pull request may close these issues.

2 participants