InitTestClass() public method

public InitTestClass ( ) : void
return void
Esempio n. 1
0
        public void IntellisenseTextBox_TextChanged_GreaterThen200msBetweenTextChanged_TextChangedFiredFourTimes()
        {
            int counter = 0;

            for (int i = 0; i < 10; i++)
            {
                //------------Setup for test--------------------------
                var mockIntellisenseTextBox = new MockIntellisenseTextbox();

                var chars = new[] { 'a', 'b', 'c', 'd' };
                mockIntellisenseTextBox.InitTestClass();

                //------------Execute Test---------------------------

                foreach (var c in chars)
                {
                    mockIntellisenseTextBox.Text = c.ToString(CultureInfo.InvariantCulture);
                    Thread.Sleep(250);
                }

                //------------Assert Results-------------------------
                Thread.Sleep(100);
                counter += mockIntellisenseTextBox.TextChangedCounter;
            }
            Assert.IsTrue(counter > 38);
        }
Esempio n. 2
0
        public void IntellisenseTextBox_TextChanged_LessThen200msBetweenTextChanged_TextChangedFiredOnce()
        {
            //------------Setup for test--------------------------
            var mockIntellisenseTextBox = new MockIntellisenseTextbox();

            var chars = new[] { 'a', 'b', 'c', 'd' };

            mockIntellisenseTextBox.InitTestClass();

            //------------Execute Test---------------------------

            foreach (var c in chars)
            {
                mockIntellisenseTextBox.Text = c.ToString(CultureInfo.InvariantCulture);
                Thread.Sleep(50);
            }

            Thread.Sleep(250);

            //------------Assert Results-------------------------
            Thread.Sleep(100);
            Assert.AreEqual(1, mockIntellisenseTextBox.TextChangedCounter);
        }
        public void IntellisenseTextBox_TextChanged_GreaterThen200msBetweenTextChanged_TextChangedFiredFourTimes()
        {
            int counter = 0;
            for (int i = 0; i < 10; i++)
            {
                //------------Setup for test--------------------------            
                var mockIntellisenseTextBox = new MockIntellisenseTextbox();

                var chars = new[] { 'a', 'b', 'c', 'd' };
                mockIntellisenseTextBox.InitTestClass();

                //------------Execute Test---------------------------

                foreach (var c in chars)
                {
                    mockIntellisenseTextBox.Text = c.ToString(CultureInfo.InvariantCulture);
                    Thread.Sleep(250);
                }

                //------------Assert Results-------------------------
                Thread.Sleep(100);
                counter += mockIntellisenseTextBox.TextChangedCounter;
                
            }
            Assert.IsTrue(counter > 38);
        }
        public void IntellisenseTextBox_TextChanged_LessThen200msBetweenTextChanged_TextChangedFiredOnce()
        {
            //------------Setup for test--------------------------            
            var mockIntellisenseTextBox = new MockIntellisenseTextbox();

            var chars = new[] { 'a', 'b', 'c', 'd' };
            mockIntellisenseTextBox.InitTestClass();

            //------------Execute Test---------------------------

            foreach(var c in chars)
            {
                mockIntellisenseTextBox.Text = c.ToString(CultureInfo.InvariantCulture);
                Thread.Sleep(50);
            }

            Thread.Sleep(250);

            //------------Assert Results-------------------------
            Thread.Sleep(100);
            Assert.AreEqual(1, mockIntellisenseTextBox.TextChangedCounter);
        }