CShell icon indicating copy to clipboard operation
CShell copied to clipboard

Unit tests

Open medmondson opened this issue 10 years ago • 8 comments

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.

medmondson avatar May 24 '14 13:05 medmondson

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

lukebuehler avatar May 29 '14 22:05 lukebuehler

I'll see what I can do around these core areas

medmondson avatar Jun 05 '14 10:06 medmondson

I would like to help here. What would be a good starting place ?

theelderwand avatar Nov 02 '15 09:11 theelderwand

@TheElderWand that would be great!

I think the priorities are as follows:

  1. CShell.Core anything in the Framework folder
  2. Other stuff in the Core
  3. 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
  4. 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.
  5. 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...?

lukebuehler avatar Nov 02 '15 15:11 lukebuehler

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.

lukebuehler avatar Nov 02 '15 15:11 lukebuehler

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!

lukebuehler avatar Nov 05 '15 21:11 lukebuehler

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.

failingunittests

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?

medmondson avatar Nov 17 '15 23:11 medmondson

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?

medmondson avatar Jan 14 '16 23:01 medmondson