public void Attach_WhenCalled_SetsText()
        {
            var behavior = new GlobalSearchTextBoxBehavior();
            var textBox = new TextBox();
            behavior.Attach(textBox);
            behavior.MinimumDelayTime = 0;

            textBox.Text = "1234";

            Assert.IsTrue(textBox.Text == "1234");
        }
        public void Detach_WhenCalled_UnsubscribeFromTextChangedEvent()
        {
            //Arrange
            var classUnderTest = new GlobalSearchTextBoxBehavior();
            var mock = Mock.Create<TextBox>(Behavior.CallOriginal);
            classUnderTest.Attach(mock);

            Mock.ArrangeSet(() => mock.TextChanged -= null).IgnoreArguments().OccursOnce();

            //Act
            classUnderTest.Detach();

            //Assert
            Mock.AssertAll(mock);
        }