Esempio n. 1
0
        internal static void StartsWith(
            string expected,
            StringActualValueDelegate actualDelegate,
            string message)
        {
            string actual = null;

            int currentWait = 0;

            do
            {
                Thread.Sleep(SLEEP_INTERVAL);

                actual = actualDelegate();

                if (actual.StartsWith(expected))
                {
                    return;
                }

                currentWait += SLEEP_INTERVAL;
            } while (currentWait <= mMaxWaitTime);

            Assert.Fail(
                string.Format("{0}. Expected starting with '{1}' but was '{2}'",
                              message, expected, actual));
        }
Esempio n. 2
0
        internal static void AreNotEqual(
            string expected,
            StringActualValueDelegate actualDelegate,
            string message)
        {
            int currentWait = 0;

            do
            {
                Thread.Sleep(SLEEP_INTERVAL);

                string actual = actualDelegate();

                if (actual != expected)
                {
                    return;
                }

                currentWait += SLEEP_INTERVAL;
            } while (currentWait <= mMaxWaitTime);

            Assert.Fail(
                string.Format("{0}. Expected different from '{1}' but was the same",
                              message, expected));
        }
Esempio n. 3
0
        internal static void IsNotNullOrEmpty(
            StringActualValueDelegate actualDelegate,
            string message)
        {
            int currentWait = 0;

            do
            {
                Thread.Sleep(SLEEP_INTERVAL);

                string result = actualDelegate();
                if (!string.IsNullOrEmpty(result))
                {
                    return;
                }

                currentWait += SLEEP_INTERVAL;
            } while (currentWait <= mMaxWaitTime);

            Assert.Fail(message);
        }