Inheritance: BaseHtmlElement
コード例 #1
0
ファイル: TestTagAttribute.cs プロジェクト: pbakshy/Selenol
        public void Init()
        {
            var webElement = MockRepository.GenerateStub<IWebElement>();
            webElement.Stub(x => x.TagName).Return("button");

            this.element = new ElementForTest(webElement);
        }
コード例 #2
0
        public void Init()
        {
            var webElement = MockRepository.GenerateStub <IWebElement>();

            webElement.Stub(x => x.TagName).Return("button");

            this.element = new ElementForTest(webElement);
        }
コード例 #3
0
        public void GetErrorMessage()
        {
            var webElement = MockRepository.GenerateStub<IWebElement>();
            webElement.Stub(x => x.TagName).Return("input");

            var element = new ElementForTest(webElement);
            var attribute = new NotInputAttribute();
            attribute.GetErrorMessage(element).Should().Be("Expected tag not in set of input, textarea, select, button, option. But was 'input'.");
        }
コード例 #4
0
        public void ValidateInCorrectElement(string tagName)
        {
            var webElement = MockRepository.GenerateStub<IWebElement>();
            webElement.Stub(x => x.TagName).Return(tagName);

            var element = new ElementForTest(webElement);
            var attribute = new NotInputAttribute();
            attribute.Validate(element).Should().BeFalse();
        }
コード例 #5
0
ファイル: TestInputAttribute.cs プロジェクト: pbakshy/Selenol
        private static void GetErrorMessageTest(string tagName, string typeName, string message)
        {
            var webElement = MockRepository.GenerateStub<IWebElement>();
            webElement.Stub(x => x.TagName).Return(tagName);
            webElement.Stub(x => x.GetAttribute("type")).Return(typeName);

            var element = new ElementForTest(webElement);
            var attribute = new InputAttribute("text");
            attribute.GetErrorMessage(element).Should().Be(message);
        }
コード例 #6
0
ファイル: TestInputAttribute.cs プロジェクト: pbakshy/Selenol
        private static void ValidateTest(string tagName, string typeName, bool result)
        {
            var webElement = MockRepository.GenerateStub<IWebElement>();
            webElement.Stub(x => x.TagName).Return(tagName);
            webElement.Stub(x => x.GetAttribute("type")).Return(typeName);

            var element = new ElementForTest(webElement);
            var attribute = new InputAttribute("button");
            attribute.Validate(element).Should().Be(result);
        }
コード例 #7
0
        public void GetErrorMessage()
        {
            var webElement = MockRepository.GenerateStub <IWebElement>();

            webElement.Stub(x => x.TagName).Return("input");

            var element   = new ElementForTest(webElement);
            var attribute = new NotInputAttribute();

            attribute.GetErrorMessage(element).Should().Be("Expected tag not in set of input, textarea, select, button, option. But was 'input'.");
        }
コード例 #8
0
        public void ValidateInCorrectElement(string tagName)
        {
            var webElement = MockRepository.GenerateStub <IWebElement>();

            webElement.Stub(x => x.TagName).Return(tagName);

            var element   = new ElementForTest(webElement);
            var attribute = new NotInputAttribute();

            attribute.Validate(element).Should().BeFalse();
        }
コード例 #9
0
        private static void GetErrorMessageTest(string tagName, string typeName, string message)
        {
            var webElement = MockRepository.GenerateStub <IWebElement>();

            webElement.Stub(x => x.TagName).Return(tagName);
            webElement.Stub(x => x.GetAttribute("type")).Return(typeName);

            var element   = new ElementForTest(webElement);
            var attribute = new InputAttribute("text");

            attribute.GetErrorMessage(element).Should().Be(message);
        }
コード例 #10
0
        private static void ValidateTest(string tagName, string typeName, bool result)
        {
            var webElement = MockRepository.GenerateStub <IWebElement>();

            webElement.Stub(x => x.TagName).Return(tagName);
            webElement.Stub(x => x.GetAttribute("type")).Return(typeName);

            var element   = new ElementForTest(webElement);
            var attribute = new InputAttribute("button");

            attribute.Validate(element).Should().Be(result);
        }