Пример #1
0
        public void ShouldNotErrorValidArea(string uprn)
        {
            var model = new SourceServiceArea()
            {
                Area = uprn
            };
            var result = _sut.TestValidate(model);

            result.ShouldNotHaveValidationErrorFor(x => x.Area);
        }
Пример #2
0
        public void ShouldErrorWithTagsInArea()
        {
            var model = new SourceServiceArea()
            {
                Area = StringWithTags
            };
            var result = _sut.TestValidate(model);

            result.ShouldHaveValidationErrorFor(x => x.Area)
            .WithErrorCode(ErrorCodes.XssCheckFailure);
        }
        public void SourceServiceAreaShouldErrorWithInvalidValue()
        {
            var invalid = new SourceServiceArea()
            {
                Area = "Some<tag>value"
            };
            var model = new ContactDetailsRequestObject()
            {
                SourceServiceArea = invalid
            };
            var result = _sut.TestValidate(model);

            result.ShouldHaveValidationErrorFor(x => x.SourceServiceArea.Area);
        }