Ejemplo n.º 1
0
        private void TestPipelineJson(JsonSampleInfo sampleInfo)
        {
            string   json     = sampleInfo.Json;
            Pipeline pipeline = this.ConvertToWrapper(json);

            CoreModel.Pipeline actual = this.Operations.Converter.ToCoreType(pipeline);

            string actualJson = Core.DataFactoryManagementClient.SerializeInternalPipelineToJson(actual);

            JsonComparer.ValidateAreSame(json, actualJson, ignoreDefaultValues: true);
            Assert.DoesNotContain("ServiceExtraProperties", actualJson);

            if (sampleInfo.Version == null ||
                !sampleInfo.Version.Equals(JsonSampleType.Unregistered, StringComparison.OrdinalIgnoreCase))
            {
                foreach (Activity activity in pipeline.Properties.Activities)
                {
                    Assert.IsNotType <GenericActivity>(activity.TypeProperties);
                }
            }

            JObject actualJObject = JObject.Parse(actualJson);

            JsonComparer.ValidatePropertyNameCasing(actualJObject, true, string.Empty, sampleInfo.PropertyBagKeys);
        }
        private LinkedService ConvertAndTestJson(string json, bool customTest = false, HashSet <string> propertyBagKeys = null)
        {
            LinkedService linkedService = this.ConvertToWrapper(json);

            CoreModel.LinkedService actual = this.Operations.Converter.ToCoreType(linkedService);

            // after converting to intermediate object, ensure that ServiceExtraProperties is still set
            if (customTest)
            {
                IGenericTypeProperties typeProperties =
                    linkedService.Properties.TypeProperties as IGenericTypeProperties;

                Assert.NotNull(typeProperties);
            }

            string actualJson = Core.DataFactoryManagementClient.SerializeInternalLinkedServiceToJson(actual);

            JsonComparer.ValidateAreSame(json, actualJson, ignoreDefaultValues: true);
            Assert.DoesNotContain("ServiceExtraProperties", actualJson);

            JObject actualJObject = JObject.Parse(actualJson);

            JsonComparer.ValidatePropertyNameCasing(actualJObject, true, string.Empty, propertyBagKeys);

            return(linkedService);
        }
Ejemplo n.º 3
0
        private void TestComputeTypeJson(JsonSampleInfo sampleInfo)
        {
            string      json        = sampleInfo.Json;
            ComputeType computeType = this.ConvertToWrapper(json);

            CoreRegistrationModel.ComputeType actual = this.Operations.Converter.ToCoreType(computeType);

            string actualJson = Core.DataFactoryManagementClient.SerializeInternalComputeTypeToJson(actual);

            JsonComparer.ValidateAreSame(json, actualJson, ignoreDefaultValues: true);
            Assert.False(actualJson.Contains("ServiceExtraProperties"));

            JObject actualJObject = JObject.Parse(actualJson);

            JsonComparer.ValidatePropertyNameCasing(actualJObject, true, string.Empty, sampleInfo.PropertyBagKeys);
        }
Ejemplo n.º 4
0
        private void TestTableJson(JsonSampleInfo info)
        {
            string json  = info.Json;
            Table  table = this.ConvertToWrapper(json);

            CoreModel.Table actual     = this.Operations.Converter.ToCoreType(table);
            string          actualJson = Core.DataFactoryManagementClient.SerializeInternalTableToJson(actual);

            JsonComparer.ValidateAreSame(json, actualJson, ignoreDefaultValues: true);

            if (info.Version == null ||
                !info.Version.Equals(JsonSampleType.Unregistered, StringComparison.OrdinalIgnoreCase))
            {
                Assert.IsNotType <GenericDataset>(table.Properties.TypeProperties);
            }

            JObject actualJObject = JObject.Parse(actualJson);

            JsonComparer.ValidatePropertyNameCasing(actualJObject, true, string.Empty, info.PropertyBagKeys);
        }