self-running C# desktop app?

  • Thread starter Thread starter Daniel Goldman
  • Start date Start date
D

Daniel Goldman

I have a C program that analyzes data. It makes tables,
graphs, other output in response to user selections.

It normally takes keyboard input into a curses-based user
interface. However, it can also run itself, forever or
until it crashes. For self-run, "input" is based on random
numbers. The self-run is useful for testing (and fun).

I'm porting the program to C#. It will have tab controls,
buttons, menus, dialog boxes, list boxes... Any ideas how
to do this kind of self-run mode for a C# desktop app?

Not looking for advice about structured testing, random #
generation, other basics. :) I'm looking for info about
automated testing like this in C# desktop app. I write
code in a text editor.

Thanks,
Daniel Goldman
 
Hi,
I am totally lost what you want, but :)
I guess you can always trap the events generated by different controls and
rise some flags and check them if the program is ready to accept next input.
This is in case that you want to simulate a real user input. If you want to
see what will happen if user just make random clicks and inputs ... hmmm,
brute force is the name :)
And also, I do not thing that you need to simulate mouse clicks and key
presses (I assume that this is well implemented in the framework), and you
want only to see the result of any different combination of inputs (i.e.
what happens if checkbox1 is selected, textfield1 contains "blabla" and user
clicks OK button). So, in your timer thread you may set a flag that it is
not finished yet, set these controls to testing values and invoke the click
event of the button. And when the corresponding operation of the click event
finishes, just set the flag back to show that the test thread can be run
again. Just create the threat in static class, and lock it while it is
executed, so you will not have 2 simultaneous executions.

Sunny
 
Back
Top