[Gambas-user] Using test interface for scripter testing
g4mba5 at gmail.com
Sat Jun 27 22:00:15 CEST 2020
Le 27/06/2020 à 21:26, Tobias Boege a écrit :
> On Sat, 27 Jun 2020, Brian G wrote:
>> I have been implementing a test framework for scripter, and some of my own apps from my experience so far these are some things I have found difficult and thus the suggestions.
>> Please understand that I really do appreciate the work that has been done and and the functionality it provides. This is a bit long!
>> I would like to suggest the following be added to test framework if possible. It would make unit testing of the application and its modules a little simpler.
>> Assert.Startup("startupModExpected") ' used to verify you have not forgotten to set to real startup ... lol
>> Assert.Exported("namelist",......... ) ' list of expected exported modules and classes fails if don't match
>> Assert.Interface("modOrClass", "interfaceFuncOrVarsOrProperty".....) ' test exported mods or classes that the interface is correct ie public functions and variables exposed, returns fail if they don't match.
>> AssertStdOut.Equal(Function(), "Expected",".....")
>> AssertStdErr.Equal(Function(), "Expected,"....")
>> Now I have to explain that most of the time, I replaced the 'got value' with the actual function call from the tested module
> These tests seem a little special to me. Did you know that you can override
> the Assert module and extend it? This is a standard Gambas feature, see .
> It allows you to add your own project-specific assertions to the Assert
> class, so it looks like they were built in. Use the primitive assertions
> as you need to build up more complex, specific ones.
Just a point: it would be possible to allow Application.Args to be
More information about the User