-
Notifications
You must be signed in to change notification settings - Fork 150
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
Resolve differences between NUnit Console and NUnitLite implementations of @filename #126
Comments
@NikolayPianikov I'm trying to understand your intention in making the ArgumentsFileParser injectable in ConsoleOptions. The tests all use SimpleFiIeParser, which merely returns the lines, but this breaks any tests I add where more than one argument appears on a line. On the surface, it seems like we would always want to parse out the arguments completely. Is there a reason for this I'm missing? Or is it something that had a purpose at one time and no longer does? |
@CharliePoole I've added class "ArgumentsFileParser", that actually does parsing (ArgumentsFileParserTests - unit tests). I would like to test behavior related to my changes in isolation too, but I did not find the usage of mock framework in this test assembly, thus I decided to add simplest implementation of parser as "SimpleArgumentsFileParser" ONLY for testing purpose as well as VirtualFileSystem. Actually I would prefer to use some mocking frameworks for it. Summing up:
If you want to change how files are parsed from text file to list of strings you should change only "ArgumentsFileParser" and "ArgumentsFromFilesTests". If you want to change how we find new files with arguments or how parsed string arguments from the files will be applied as command line arguments you should change only "ConsoleOptions" and "CommandLineTests." |
So I guess you broke this out into a separate file and created a simple "mock" because you wanted to separate the concerns into different classes. It's reasonable, but not how it is done NUnitLite, where the separation is only into different methods of the same class. I will have to decide whether to keep this difference or change one of the two. |
We have usually used NSubstitute for mocks. That would require targeting .NET 3.5 for the tests although the console itself could still target 2.0. We have done that it some other situations |
I also use NSubstitute for mocks with NUnit.. I ported the current release to CF, so works with all of my users test on CF as well. |
@CharliePoole commented on Mon Oct 31 2016
We (well actually I) mistakenly merged the nunitlite changes thinking that the differences between the console runner and nunitlite implementations had already been resolved between @NikolayPianikov and @oznetmaster
We need to decide first what features to include / exclude then change one or both of them so that users do not get confused and features we have not decided to support do not become supported by default.
Eventually, we should also resolve code differences for the common features but that can await the point where we create a shared codebase for conmmand-line option processing.
I'm putting this in the discussion pipeline so that the NUnit team can work out what we want to support. Everyone else is welcome to participate in the discussion as well.
@NikolayPianikov commented on Tue Nov 01 2016
I've used Regex from @oznetmaster and I could add the nesting of any levels during 5 minutes if it is needed. I agree it would be better to have one code base and it doesn't matter for me which code will be preferable. I am just interested in implementation of this feature.
So I would like to highlight some questions:
About requirements:
About implementation:
@CharliePoole commented on Tue Nov 01 2016
I support @oznetmaster 's proposal in PR #1856:
"I guess I am recommending we leave at least one level of nesting (currently my code has two - it is only a constant), and remove the alternative delimiter. Then modify the console code to support the same syntax."
I think this is a minimum fix that will keep users from getting confused.
As already stated, I don't support trying to make the code common right now. There's a bigger project I would like to do that would include this: developing an entire shared codebase for option handling, including our own version of Options.cs and using a submodule to share the code. But we have many more high priority things to worry about right now, so I think this can wait. So long as the two bits of code actually do the same thing, we will avoid complaints from our users.
@CharliePoole commented on Tue Nov 01 2016
I intended this to be in the Discussion pipeline when I created it but didn't put it there.
@NikolayPianikov Once we are done discussing and have decided on a course of action, we'll move it to the Backlog. Someone will decide to do it or we will pick someone. Then they will do it. 😄
@CharliePoole commented on Sat Nov 05 2016
OK... I don't see any action on this folks, so I'll lay out a proposal...
Let's allow a single level of nesting and remove the alternative delimiter as @oznetmaster suggested.
If this is agreed upon, then we need to
@rprouse @oznetmaster @NikolayPianikov Do you agree?
@oznetmaster commented on Sat Nov 05 2016
The number of levels of nesting in my code is a constant. It is only there to eliminate the possibility of infinite recursion. It serves no other function.
Removing the alternative delimiter is easy.
@rprouse commented on Sat Nov 05 2016
Agreed to all points.
@CharliePoole commented on Sat Nov 05 2016
Replicating the issue for nunit-console
The text was updated successfully, but these errors were encountered: