CShell
CShell copied to clipboard
Unit tests
I think it would be advantageous to write unit tests around the particularly complicated sections of code. I don't see this as a solvable issue, but more of an ongoing task. Without tests it's easy for the code base to regress in a non-obvious way, which could be a problem considering the complexity of the project.
Agree 100%, this need to be a parallel effort with getting the ScriptCS integration working. While it might be difficult to add tests for many UI specific stuff, at least we can test:
- CShell.Core
- CShell.Completion
- CShell.Hosting
I'll see what I can do around these core areas
I would like to help here. What would be a good starting place ?
@TheElderWand that would be great!
I think the priorities are as follows:
- CShell.Core anything in the Framework folder
- Other stuff in the Core
- CShell.Hosting might need some refactoring to test it properly but feel free to go at it. If it's larger stuff check back with me first
- CShell.Completion, depsperately needs tests, BUT I'm planing a major refactoring of this code we should do it in conjunction with that otherwise much effort might be lost here.
- Anything in the CShell project, start with modules and anything that has been broken out. Ideally I'd like to start writing test for the REPL control but I'm not sure how testable it is...?
Also see what you can salvage from the PR #42
Regarding testing framework I personally prefer NUnit, but I'm open to suggestions. We might want to consider what ScriptCS is using since we are building on their functionality substantially.
Alright I merged PR #42, and that should give a general direction where further tests can go, this is for CShell.Hosting. But I think that's not a bad place to start!
Unfortunately the tests introduced in #42 all fail on my box with the same message:
System.IO.FileNotFoundException : Could not load file or assembly 'Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The system cannot find the file specified.
This is not a build issue but instead the failing tests.
Am I doing something wrong or are these dependencies missing from the source? Any thoughts around a build server which would catch these sorts of issues early?
Could you confirm these tests actually pass on your side? I've pulled the project fresh and these fail. Would you be interested if I can set up a build server for this?