示例#1
0
        public void when_creating_xpath_css_class_with_valid_values(string cssClass, string expectedResult)
        {
            var result = _builder.GetCssClassPart(cssClass);

            result.ShouldBe(expectedResult);

            _cssValidator.Received(1).ValidateClassName(cssClass);

            _xPathValidator.DidNotReceiveWithAnyArgs().IsReservedFunctionName(Arg.Any <string>());
            _xPathValidator.DidNotReceiveWithAnyArgs().ValidateQName(Arg.Any <string>(), Arg.Any <string>());
            _xPathValidator.DidNotReceiveWithAnyArgs().ValidateNCName(Arg.Any <string>(), Arg.Any <string>());
        }
        public void when_creating_text_with_valid_values(string text, string expectedResult)
        {
            var result = _builder.GetTextPart(text);

            result.ShouldBe(expectedResult);

            _cssValidator.DidNotReceiveWithAnyArgs().ValidateClassName(Arg.Any <string>());

            _xPathValidator.DidNotReceiveWithAnyArgs().IsReservedFunctionName(Arg.Any <string>());
            _xPathValidator.DidNotReceiveWithAnyArgs().ValidateQName(Arg.Any <string>(), Arg.Any <string>());
            _xPathValidator.DidNotReceiveWithAnyArgs().ValidateNCName(Arg.Any <string>(), Arg.Any <string>());
        }
示例#3
0
        public void when_creating_xpath_tag_with_valid_values()
        {
            var result = _builder.GetTagNamePart("valid:TagName");

            result.ShouldBe("valid:TagName");

            _xPathValidator.Received(1).ValidateQName("valid:TagName", "Tag Name");
            _xPathValidator.DidNotReceiveWithAnyArgs().ValidateNCName(Arg.Any <string>(), Arg.Any <string>());
            _xPathValidator.Received(1).IsReservedFunctionName("valid:TagName");

            _cssValidator.DidNotReceiveWithAnyArgs().ValidateClassName(Arg.Any <string>());
        }
        public void when_creating_xpath_attribute_with_null_attribute_name(string attributeValue, string expectedResult)
        {
            var result = _builder.GetAttributePart(null, attributeValue);

            result.ShouldBe(expectedResult);

            _cssValidatorMock.DidNotReceiveWithAnyArgs().ValidateClassName(Arg.Any <string>());

            _xPathValidatorMock.DidNotReceiveWithAnyArgs().IsReservedFunctionName(Arg.Any <string>());
            _xPathValidatorMock.DidNotReceiveWithAnyArgs().ValidateQName(Arg.Any <string>(), Arg.Any <string>());
            _xPathValidatorMock.DidNotReceiveWithAnyArgs().ValidateNCName(Arg.Any <string>(), Arg.Any <string>());
        }