Esempio n. 1
0
        public StoreDatasetValidatorTests()
        {
            var featureConfiguration = Options.Create(new FeatureConfiguration()
            {
                EnableFullDicomItemValidation = false
            });
            var minValidator = new ElementMinimumValidator();

            _queryTagService = Substitute.For <IQueryTagService>();
            _queryTags       = new List <QueryTag>(QueryTagService.CoreQueryTags);
            _queryTagService.GetQueryTagsAsync(Arg.Any <CancellationToken>()).Returns(_queryTags);
            _dicomDatasetValidator = new StoreDatasetValidator(featureConfiguration, minValidator, _queryTagService);
        }
Esempio n. 2
0
        public async Task GivenDatasetWithInvalidVrValue_WhenValidatingWithFullValidation_ThenDatasetValidationExceptionShouldBeThrown()
        {
            var featureConfiguration = Substitute.For <IOptions <FeatureConfiguration> >();

            featureConfiguration.Value.Returns(new FeatureConfiguration
            {
                EnableFullDicomItemValidation = true,
            });
            var minValidator = new ElementMinimumValidator();

            _dicomDatasetValidator = new StoreDatasetValidator(featureConfiguration, minValidator, _queryTagService);

            // LO VR, invalid characters
            _dicomDataset.Add(DicomTag.SeriesDescription, "CT1 abdomen\u0000");

            await ExecuteAndValidateException <DatasetValidationException>(ValidationFailedFailureCode);
        }