MVVM testing
- [x] Create a token stream, then a parse tree from the input
- [x] successfully construct visualizer data from string, token stream, and parse tree
- [x] successfully construct a viewmodel from visualizer data
- [x] Pass an invalid/missing config to VisualizerData constructor
- [x] invalid lexer
- [x] invalid parser
- [x] invalid method name
- [ ] deserialize visualizerdata, configviewmodel, visualizerdataviewmodel from stored JSON; compare against constructed
- [ ] change selection on viewmodel; verify changes to selection
- [ ] from viewmodel selection source properties
- [ ] from root treeview model
- [ ] from token list
- [ ] Config.Clone
Relevant: https://www.pluralsight.com/courses/wpf-mvvm-test-driven-development-viewmodels
Questions:
- Should we test autofill of lexer and parser when there is no selected? Currently we can test this, because there is only one lexer and parser in all the loaded assemblies. But we may add more lexers and parsers in the future.
The only known bug related to selection is #42.
Test cases (two test projects):
- Antlr.Standard.Runtime -- Java ANTLR-generated lexer + parser, reference DLL
- short Java file
- long Java file
- short Java file with errors
- Antlr.Runtime -- antlr-cs - generated lexer + parser, reference RubberDuck DLL
- short VBA input
- long VBA input
- short VBA input with errors
Should the test project be in .NET Framework or .NET Core?
Antlr.Runtime can only be used from .NET Framework, so any tests which target this must use .NET Framework.
Tests against Antlr.Runtime.Standard can be either in .NET Framework or .NET Core.
Related #60
Should the test project be in .NET Framework or .NET Core?
Antlr.Runtime can only be used from .NET Framework, so any tests which target this must use .NET Framework.
Tests against Antlr.Runtime.Standard can be either in .NET Framework or .NET Core.
We've resolved this. Antlr.Runtime can be used from .NET Framework, .NET Core, and .NET 5. Test projects target net5.0-windows; there's currently no need for multitargeting.