Inheritance: System.Attribute, IElementValidator
コード例 #1
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);
        }
コード例 #2
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);
        }