Esempio n. 1
0
        public void WaitForListOfActionsMultipleTimeTest()
        {
            DateTime start = DateTime.Now;
            TimeSpan max   = TimeSpan.FromSeconds(2);

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

            GenericWait.WaitForAnyAction <bool>(
                "WaitForListOfActions",
                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);
        }
Esempio n. 2
0
        public void WaitForListOfActionsException()
        {
            DateTime dateToTest = DateTime.Now.AddSeconds(120);

            GenericWait.WaitForAnyAction <bool>(
                "WaitForListOfActionsException",
                () =>
            {
                Assert.IsTrue(dateToTest < DateTime.Now);
                return(true);
            },
                () =>
            {
                Assert.IsTrue(dateToTest < DateTime.Now);
                return(true);
            });
        }
Esempio n. 3
0
        public void WaitForListOfActions()
        {
            DateTime dateToTest = DateTime.Now.AddSeconds(1);
            bool     result     = GenericWait.WaitForAnyAction <bool>(
                "WaitForListOfActions",
                TimeSpan.FromSeconds(2),
                TimeSpan.FromSeconds(0.5),
                () =>
            {
                Assert.IsTrue(dateToTest < DateTime.Now);
                return(true);
            },
                () =>
            {
                Assert.IsTrue(dateToTest < DateTime.Now);
                return(true);
            });

            Assert.IsTrue(result, "WaitForListOfActions waiting was successful");
        }
Esempio n. 4
0
        public void WaitForListOfActionsMultiple()
        {
            DateTime dateToTest      = DateTime.Now.AddSeconds(120);
            DateTime otherDateToTest = DateTime.Now.AddSeconds(1);
            bool     result          = GenericWait.WaitForAnyAction <bool>(
                "WaitForListOfActions",
                TimeSpan.FromSeconds(2),
                TimeSpan.FromSeconds(0.5),
                () =>
            {
                Assert.IsTrue(dateToTest < DateTime.Now);
                return(true);
            },
                () =>
            {
                Assert.IsTrue(otherDateToTest < DateTime.Now);
                return(true);
            });

            Assert.IsTrue(result, "Condition was met");
        }