OpenQA.Selenium.ExecutingAsyncJavascriptTest.ShouldBeAbleToReturnArraysOfPrimitivesFromAsyncScripts C# (CSharp) Méthode

ShouldBeAbleToReturnArraysOfPrimitivesFromAsyncScripts() private méthode

private ShouldBeAbleToReturnArraysOfPrimitivesFromAsyncScripts ( ) : void
Résultat void
        public void ShouldBeAbleToReturnArraysOfPrimitivesFromAsyncScripts()
        {
            driver.Url = ajaxyPage;

            object result = executor.ExecuteAsyncScript("arguments[arguments.length - 1]([null, 123, 'abc', true, false]);");
            Assert.IsNotNull(result);
            Assert.IsInstanceOf<ReadOnlyCollection<object>>(result);
            ReadOnlyCollection<object> resultList = result as ReadOnlyCollection<object>;
            Assert.AreEqual(5, resultList.Count);
            Assert.IsNull(resultList[0]);
            Assert.AreEqual(123, (long)resultList[1]);
            Assert.AreEqual("abc", resultList[2].ToString());
            Assert.IsTrue((bool)resultList[3]);
            Assert.IsFalse((bool)resultList[4]);
        }