Example #1
0
        public void CachesIfClassMarkedCachedElement()
        {
            Expect.Once.On(mockDriver).Method("FindElement").With(By.Name("someForm")).Will(Return.Value(mockElement));
            Expect.Exactly(2).On(mockElement).GetProperty("TagName").Will(Return.Value("form"));

            var page = new CachedClassPage();

            AssertFindsElement(page, () => page.formElement);
            AssertFoundElement(page.formElement);
        }
Example #2
0
        public void CachesIfClassMarkedCachedElement()
        {
            mockDriver.Expects.One.Method(_ => _.FindElement(null)).With(By.Name("someForm")).WillReturn(mockElement.MockObject);
            mockElement.Expects.Exactly(2).GetProperty(_ => _.TagName).WillReturn("form");

            var page = new CachedClassPage();

            AssertFindsElement(page, () => page.formElement);
            AssertFoundElement(page.formElement);
        }
        public void CachesIfClassMarkedCachedElement()
        {
            mockDriver.Setup(_ => _.FindElement(It.Is <By>(x => x.Equals(By.Name("someForm"))))).Returns(mockElement.Object);
            mockElement.SetupGet <string>(_ => _.TagName).Returns("form");

            var page = new CachedClassPage();

            AssertFindsElement(page, () => page.formElement);
            AssertFoundElement(page.formElement);
            mockDriver.Verify(_ => _.FindElement(By.Name("someForm")), Times.Once);
            mockElement.Verify(_ => _.TagName, Times.Exactly(2));
        }
Example #4
0
        public void CachesIfClassMarkedCachedElement()
        {
            Expect.Once.On(mockDriver).Method("FindElement").With(By.Name("someForm")).Will(Return.Value(mockElement));
            Expect.Exactly(2).On(mockElement).GetProperty("TagName").Will(Return.Value("form"));

            var page = new CachedClassPage();

            AssertFindsElement(page, () => page.formElement);
            AssertFoundElement(page.formElement);
        }