CallSelectClick() public method

public CallSelectClick ( ) : void
return void
コード例 #1
0
        public void Test_SelectButtonWhenClicked_ShouldApplyBusinessObjectChanges(bool enableEditing)
        {
            //---------------Set up test pack-------------------
            GetClassDefs();
            IControlFactory          controlFactory     = GetControlFactory();
            ExtendedTextBoxWin       extendedTextBoxWin = new ExtendedTextBoxWin(controlFactory);
            const string             propName           = "OrganisationID";
            ExtendedTextBoxMapperSpy mapperSpy          = new ExtendedTextBoxMapperSpy(
                extendedTextBoxWin, propName, true, controlFactory);

            mapperSpy.EnableEditing = enableEditing;
            ContactPersonTestBO contactPersonTestBo = new ContactPersonTestBO();

            mapperSpy.BusinessObject = contactPersonTestBo;
            var expectedSelectedBO = new OrganisationTestBO();

            //---------------Assert Precondition----------------
            Assert.AreSame(contactPersonTestBo, mapperSpy.BusinessObject);
            Assert.IsNull(contactPersonTestBo.OrganisationID);
            //---------------Execute Test ----------------------
            mapperSpy.CallSetupPopupForm();
            mapperSpy.SetSelectedBusinessObject(expectedSelectedBO);
            mapperSpy.CallSelectClick();
            //---------------Test Result -----------------------
            Assert.IsNotNull(contactPersonTestBo.OrganisationID);
            Assert.AreSame(expectedSelectedBO, contactPersonTestBo.Organisation);
        }
コード例 #2
0
        public void Test_SelectButtonWhenClicked_ShouldClosePopupForm()
        {
            GetClassDefs();
            IControlFactory          controlFactory     = GetControlFactory();
            ExtendedTextBoxWin       extendedTextBoxWin = new ExtendedTextBoxWin(controlFactory);
            const string             propName           = "OrganisationID";
            ExtendedTextBoxMapperSpy mapperSpy          = new ExtendedTextBoxMapperSpy(
                extendedTextBoxWin, propName, true, controlFactory);
            ContactPersonTestBO contactPersonTestBo = new ContactPersonTestBO();

            mapperSpy.BusinessObject = contactPersonTestBo;
            //---------------Assert Precondition----------------
            Assert.IsFalse(mapperSpy.FormClosed);
            //---------------Execute Test ----------------------
            mapperSpy.CallSetupPopupForm();
            mapperSpy.CallSelectClick();
            //---------------Test Result -----------------------
            Assert.IsTrue(mapperSpy.FormClosed);
        }
コード例 #3
0
        public void Test_SelectButtonWhenClicked_AndContactPersonNotValid_ShouldCloseWithoutError_FixBugBug541()
        {
            GetClassDefs();
            IControlFactory          controlFactory     = GetControlFactory();
            ExtendedTextBoxWin       extendedTextBoxWin = new ExtendedTextBoxWin(controlFactory);
            const string             propName           = "OrganisationID";
            ExtendedTextBoxMapperSpy mapperSpy          = new ExtendedTextBoxMapperSpy(
                extendedTextBoxWin, propName, true, controlFactory);
            ContactPersonTestBO contactPersonTestBo = new ContactPersonTestBO();

            mapperSpy.BusinessObject = contactPersonTestBo;
            mapperSpy.SelectedBO     = new OrganisationTestBO();
            //---------------Assert Precondition----------------
            Assert.IsFalse(mapperSpy.FormClosed);
            Assert.IsFalse(contactPersonTestBo.Status.IsValid());
            Assert.IsTrue(mapperSpy.SelectedBO.Status.IsValid());
            Assert.IsNotNull(mapperSpy.SelectedBO);
            //---------------Execute Test ----------------------
            mapperSpy.CallSetupPopupForm();
            mapperSpy.CallSelectClick();
            //---------------Test Result -----------------------
            Assert.IsFalse(contactPersonTestBo.Status.IsValid());
            Assert.IsTrue(mapperSpy.FormClosed);
        }
コード例 #4
0
 public void Test_SelectButtonWhenClicked_AndContactPersonNotValid_ShouldCloseWithoutError_FixBugBug541()
 {
     GetClassDefs();
     IControlFactory controlFactory = GetControlFactory();
     ExtendedTextBoxWin extendedTextBoxWin = new ExtendedTextBoxWin(controlFactory);
     const string propName = "OrganisationID";
     ExtendedTextBoxMapperSpy mapperSpy = new ExtendedTextBoxMapperSpy(
         extendedTextBoxWin, propName, true, controlFactory);
     ContactPersonTestBO contactPersonTestBo = new ContactPersonTestBO();
     mapperSpy.BusinessObject = contactPersonTestBo;
     mapperSpy.SelectedBO = new OrganisationTestBO();
     //---------------Assert Precondition----------------
     Assert.IsFalse(mapperSpy.FormClosed);
     Assert.IsFalse(contactPersonTestBo.Status.IsValid());
     Assert.IsTrue(mapperSpy.SelectedBO.Status.IsValid());
     Assert.IsNotNull(mapperSpy.SelectedBO);
     //---------------Execute Test ----------------------
     mapperSpy.CallSetupPopupForm();
     mapperSpy.CallSelectClick();
     //---------------Test Result -----------------------
     Assert.IsFalse(contactPersonTestBo.Status.IsValid());
     Assert.IsTrue(mapperSpy.FormClosed);
 }
コード例 #5
0
 public void Test_SelectButtonWhenClicked_ShouldClosePopupForm()
 {
     GetClassDefs();
     IControlFactory controlFactory = GetControlFactory();
     ExtendedTextBoxWin extendedTextBoxWin = new ExtendedTextBoxWin(controlFactory);
     const string propName = "OrganisationID";
     ExtendedTextBoxMapperSpy mapperSpy = new ExtendedTextBoxMapperSpy(
         extendedTextBoxWin, propName, true, controlFactory);
     ContactPersonTestBO contactPersonTestBo = new ContactPersonTestBO();
     mapperSpy.BusinessObject = contactPersonTestBo;
     //---------------Assert Precondition----------------
     Assert.IsFalse(mapperSpy.FormClosed);
     //---------------Execute Test ----------------------
     mapperSpy.CallSetupPopupForm();
     mapperSpy.CallSelectClick();
     //---------------Test Result -----------------------
     Assert.IsTrue(mapperSpy.FormClosed);
 }
コード例 #6
0
 public void Test_SelectButtonWhenClicked_ShouldApplyBusinessObjectChanges(bool enableEditing)
 {
     //---------------Set up test pack-------------------
     GetClassDefs();
     IControlFactory controlFactory = GetControlFactory();
     ExtendedTextBoxWin extendedTextBoxWin = new ExtendedTextBoxWin(controlFactory);
     const string propName = "OrganisationID";
     ExtendedTextBoxMapperSpy mapperSpy = new ExtendedTextBoxMapperSpy(
         extendedTextBoxWin, propName, true, controlFactory);
     mapperSpy.EnableEditing = enableEditing;
     ContactPersonTestBO contactPersonTestBo = new ContactPersonTestBO();
     mapperSpy.BusinessObject = contactPersonTestBo;
     var expectedSelectedBO = new OrganisationTestBO();
     //---------------Assert Precondition----------------
     Assert.AreSame(contactPersonTestBo, mapperSpy.BusinessObject);
     Assert.IsNull(contactPersonTestBo.OrganisationID);
     //---------------Execute Test ----------------------
     mapperSpy.CallSetupPopupForm();
     mapperSpy.SetSelectedBusinessObject(expectedSelectedBO);
     mapperSpy.CallSelectClick();
     //---------------Test Result -----------------------
     Assert.IsNotNull(contactPersonTestBo.OrganisationID);
     Assert.AreSame(expectedSelectedBO, contactPersonTestBo.Organisation);
 }