Update for expecting the specific message box

Coordinator
Jan 8, 2009 at 6:33 AM
In the first release there's no way to expect a specific message box. There are only 2 methods on expecting the message box, both of them are wildcard expectation which means if you utilize ExpectMessageBox all message boxes will be handled. You cannot verify if they are the ones you want. Now today I modified some parts of message box expectation and then you can expect the specific ones in your unit test.

I extended the old 2 methods to 6 which are:
  • ExpectMessageBox(): Expect all message boxes by the default delegation and unlimited times.
  • ExpectMessageBox(ModalFormActivated Handler): Expect all message boxes by customized delegation and unlimited times.
  • ExpectMessageBox(string Text): Expect the message box which the prompt(text) was specified, by the default delegation and unlimited times.
  • ExpectMessageBox(string Text, int ExpectTimes): Expect the message box which the prompt(text) was specified, by the default delegation and specific times.
  • ExpectMessageBox(string Text, ModalFormActivated Handler): Expect the message box which the prompt(text) was specified, by customized delegation and unlimited times.
  • ExpectMessageBox(string Text, int ExpectedTimes, ModalFormActivated Handler): Expect the message box which the prompt(text) was specified, by customized delegation and spcific times.

Another minor reflectoring with the one below I made was I removed the Strict parameter in BeginDialogExpectation() method in FormTester class. It means that the dialog expectation will be strict by default. If you want to expect all dialog windows you can use ExpectDialog() or ExpectDialog(ModalFormActivated Handler) methods. But we still provided ExpectAny() and ExpectAny(ModalFormActivated Handler) methods to make it possible to expect all kinds of both dialog windows and message boxes.

Enjoy xUnitForms. Hope this's helpful to you.