public void Test_CancelButton_WhenClicked_ShouldCancelEditsAndCloseForm() { //---------------Set up test pack------------------- GetClassDefs(); IControlFactory controlFactory = GetControlFactory(); ExtendedTextBoxVWG extendedTextBoxVWG = new ExtendedTextBoxVWG(controlFactory); const string propName = "OrganisationID"; ExtendedTextBoxMapperSpy mapper = new ExtendedTextBoxMapperSpy( extendedTextBoxVWG, propName, true, controlFactory); mapper.BusinessObject = new ContactPersonTestBO(); mapper.CallSetupPopupForm(); //---------------Assert Precondition---------------- Assert.IsFalse(mapper.FormClosed); //---------------Execute Test ---------------------- mapper.CallCancelClick(); //---------------Test Result ----------------------- Assert.IsTrue(mapper.FormClosed); }