chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes
Hi,

Again unsing NUniForms to test a form containing a grid.
I need to be able from my NUNit test to instruct an underlying
layer on demand to to send information.

Currently this is done with a underlying test harness which
offers a remoting interface where I can request it to send
information from my NUnit Test Script.

My question is do you have a mocking pattern for doing
such activities using TypeMock?

Regards
asked by steven@hawkes.ch (640 points)

3 Answers

0 votes
Hi,
I am finding it a bit hard to answer, as I don't underderstand the scenario.
I guess that you mean that you are trying to simulate an event driven system. If you wrote the code of the event system, to simulate an event on demand, just send that event using the normal API's (if possible) or you might need to use relection to call private methods.
If the event system is highly coupled with other systems that you don't really want you can use TypeMock.NET to mock those other systems.

Can you post a sample scenario?
answered by scott (32k points)
0 votes
The scenario is a push system where in the real world the grids just
display what isa pushed to them. So to test this sort of scenario using NUnit
you need to somehow tell some backend component to send data to the grid and then test that it has been dislayed correctly.

My question was if this was possible with TypeMock. I am looking for some sort of push test pattern.
answered by steven@hawkes.ch (640 points)
0 votes
Hi,
you need to somehow tell some backend component to send data to the grid and then test that it has been dislayed correctly.


Why don't you simply send the event to the grid.
eg. If the backend sends a MyEvent to the grid, in your test create a MyEvent and send it to the grid.
backend.FireEvent(new MyEvent());

(if FireEvent is not public you can use reflection to call it).
answered by scott (32k points)
...