Exemplo n.º 1
0
        public void Test_AddUpdateBoPropOnValueChangedHandler_WhenMapperUsingControlAdapter_ShouldAddBehaviours()
        {
            //---------------Set up test pack-------------------
            var txt           = GetWinFormsControlAdapter();
            var textBoxMapper = new TextBoxMapperStub(txt);

            //---------------Assert textBoxMapperStub----------------
            Assert.IsInstanceOf <TextBox>(textBoxMapper.Control.GetControl());
            Assert.IsInstanceOf <TextBox>(textBoxMapper.GetControl());
            //---------------Execute Test ----------------------
            var comboBoxStrategyWin = new TextBoxMapperStrategyWin();

            comboBoxStrategyWin.AddUpdateBoPropOnTextChangedHandler(textBoxMapper, GenerateStub <IBOProp>());
            //---------------Assert Result----------------------
            Assert.IsTrue(true, "If an error was not thrown then we are OK");
        }
Exemplo n.º 2
0
        public void Test_AddUpdateBoPropOnValueChangedHandler_WhenMapperUsingHabaneroControl_ShouldAddBehaviours()
        {
            //---------------Set up test pack-------------------
            var txt = new TextBoxWin {
                Name = "TestTextBox", Enabled = true
            };
            var textBoxMapper = new TextBoxMapperStub(txt);

            //---------------Assert Precondition----------------
            Assert.IsInstanceOf <ITextBox>(textBoxMapper.Control);
            //---------------Execute Test ----------------------
            var comboBoxStrategyWin = new TextBoxMapperStrategyWin();

            comboBoxStrategyWin.AddUpdateBoPropOnTextChangedHandler(textBoxMapper, GenerateStub <IBOProp>());
            //---------------Assert Result----------------------
            Assert.IsTrue(true, "If an error was not thrown then we are OK");
        }