public void TestBuild(string file)
 {
     var registry = RegistryInterface.Load(file);
     
     var queryBuilderV2 = new ConstrainQueryBuilderV2();
     var structureReferences = queryBuilderV2.Build(registry.QueryStructureRequest);
     Assert.IsNotEmpty(structureReferences);
 }
        public void TestBuildCustom(string file)
        {
            var registry = RegistryInterface.Load(file);

            var queryBuilderV2 = new ConstrainQueryBuilderV2();
            var structureReferences = queryBuilderV2.Build(registry.QueryStructureRequest);
            Assert.IsNotEmpty(structureReferences);
            foreach (var reference in structureReferences)
            {
                if (reference.MaintainableStructureEnumType.EnumType == SdmxStructureEnumType.Dataflow)
                {
                    var constrainable = reference as ConstrainableStructureReference;
                    Assert.NotNull(constrainable);
                    Assert.NotNull(constrainable.ConstraintObject);
                }
            }
        }
 public void TestBuildStructureQuery(string testFile)
 {
     var registry = RegistryInterface.Load(testFile);
     
     var queryBuilderV2 = new ConstrainQueryBuilderV2();
     var structureReferences = queryBuilderV2.Build(registry.QueryStructureRequest);
     
     IQueryStructureRequestBuilder<XDocument> builder = new QueryStructureRequestBuilderV2(new HeaderImpl(registry.Content.Header));
     var document = builder.BuildStructureQuery(structureReferences, registry.QueryStructureRequest.resolveReferences);
     Assert.NotNull(document);
     Assert.NotNull(document.Root);
     var file = new FileInfo(testFile);
     document.Save("TestBuildStructureQuery" + file.Name);
     if (document.Root != null)
     {
         var element = document.Descendants(document.Root.Name.Namespace + "QueryStructureRequest").First();
         Assert.IsTrue(XNode.DeepEquals(registry.QueryStructureRequest.Untyped, element), registry.QueryStructureRequest.Untyped + "\n\nnvs\n\n" + element);
     }
 }