Example #1
0
        public void WaitUntilListOfActionsMultipleTimeTest()
        {
            DateTime start = DateTime.Now;
            TimeSpan max   = TimeSpan.FromSeconds(2);

            DateTime dateToTest      = DateTime.Now.AddSeconds(120);
            DateTime otherDateToTest = DateTime.Now.AddSeconds(1);

            GenericWait.WaitUntilAnyAction <bool>(
                "WaitUntilListOfActionsMultiple",
                TimeSpan.FromSeconds(2),
                TimeSpan.FromSeconds(0.5),
                () =>
            {
                Assert.IsTrue(dateToTest < DateTime.Now);
                return(true);
            },
                () =>
            {
                Assert.IsTrue(otherDateToTest < DateTime.Now);
                return(true);
            });

            TimeSpan duration = DateTime.Now - start;

            Assert.IsTrue(duration < max, "WaitUntilListOfActionsMultipleTestTook longer than " + duration);
        }
Example #2
0
        public void WaitUntilListOfActionsFalse()
        {
            DateTime dateToTest = DateTime.Now.AddSeconds(120);
            var      result     = GenericWait.WaitUntilAnyAction(
                "WaitUntilListOfActionsFalse",
                () =>
            {
                Assert.IsTrue(dateToTest < DateTime.Now);
                return(true);
            });

            Assert.IsFalse(result, "Result for WaitUntilListOfActionsFalse was not false.");
        }
Example #3
0
        public void WaitUntilListOfActions()
        {
            DateTime dateToTest = DateTime.Now.AddSeconds(1);
            bool     result     = GenericWait.WaitUntilAnyAction <bool>(
                "WaitUntilListOfActions",
                TimeSpan.FromSeconds(2),
                TimeSpan.FromSeconds(0.5),
                () =>
            {
                Assert.IsTrue(dateToTest < DateTime.Now);
                return(true);
            },
                () =>
            {
                Assert.IsTrue(dateToTest < DateTime.Now);
                return(true);
            });

            Assert.IsTrue(result, "WaitUntilListOfActions waiting was unsuccessful");
        }
Example #4
0
        public void WaitUntilListOfActionsMultipleFalseTest()
        {
            DateTime dateToTest      = DateTime.Now.AddSeconds(120);
            DateTime otherDateToTest = DateTime.Now.AddSeconds(120);
            bool     result          = GenericWait.WaitUntilAnyAction <bool>(
                "WaitUntilListOfActionsMultiple",
                TimeSpan.FromSeconds(2),
                TimeSpan.FromSeconds(0.5),
                () =>
            {
                Assert.IsTrue(dateToTest < DateTime.Now);
                return(true);
            },
                () =>
            {
                Assert.IsTrue(otherDateToTest < DateTime.Now);
                return(true);
            });

            Assert.IsFalse(result, "WaitUntilListOfActionsMultiple resulted in a true statement");
        }