Ejemplo n.º 1
0
 public GeographyPropertyValues(ITestGeography tripLegGeography1, ITestGeography tripLegGeography2, ITestGeography amusementParkGeography, string amusementParkName, ITestGeography restStopGeography)
 {
     this.TripLegGeography1      = tripLegGeography1;
     this.TripLegGeography2      = tripLegGeography2;
     this.AmusementParkGeography = amusementParkGeography;
     this.AmusementParkName      = amusementParkName;
     this.RestStopGeography      = restStopGeography;
 }
Ejemplo n.º 2
0
        private static void VerifyGeographyProperty(XElement properties, string propertyName, ITestGeography expectedValue)
        {
            XElement property = GetProperty(properties, propertyName);
            XAttribute typeAttribute = property.Attribute(UnitTestsUtil.MetadataNamespace + "type");
            if (typeAttribute != null)
            {
                string actualType = property.Attribute(UnitTestsUtil.MetadataNamespace + "type").Value;
                string expectedtype = GetExpectedEdmShortQualifiedTypeName(expectedValue.AsGeography().GetType());
                Assert.AreEqual(expectedtype, actualType, "Type on Geography property is incorrect");
            }

            expectedValue.VerifyGmlContent(property);
        }
Ejemplo n.º 3
0
 public GeographyPropertyValues(ITestGeography tripLegGeography1, ITestGeography tripLegGeography2, ITestGeography amusementParkGeography, string amusementParkName, ITestGeography restStopGeography)
 {
     this.TripLegGeography1 = tripLegGeography1;
     this.TripLegGeography2 = tripLegGeography2;
     this.AmusementParkGeography = amusementParkGeography;
     this.AmusementParkName = amusementParkName;
     this.RestStopGeography = restStopGeography;
 }
Ejemplo n.º 4
0
        internal static DSPResource CreateRestStopResource(DSPMetadata roadTripMetadata, int id, ITestGeography location, bool useComplexType, Action<string, List<KeyValuePair<string, object>>> modifyPropertyValues)
        {
            List<KeyValuePair<string, object>> restStopPropertyValues = new List<KeyValuePair<string, object>>()
            {
                new KeyValuePair<string, object>("GeographyProperty", location.AsGeography()),
            };

            if (modifyPropertyValues != null)
            {
                modifyPropertyValues("RestStop", restStopPropertyValues);
            }

            DSPResource restStopResource = CreateResource(roadTripMetadata, "RestStop", id, restStopPropertyValues.ToArray(), useComplexType);
            return restStopResource;
        }
Ejemplo n.º 5
0
        internal static DSPResource CreateAmusementParkResource(DSPMetadata roadTripMetadata, int id, ITestGeography location, string name, bool useComplexType, Action<string, List<KeyValuePair<string, object>>> modifyPropertyValues)
        {
            List<KeyValuePair<string, object>> amusementParkPropertyValues = new List<KeyValuePair<string, object>>()
            {
                new KeyValuePair<string, object>("GeographyProperty", location.AsGeography()),
                new KeyValuePair<string, object>("Name", name),
            };

            if (modifyPropertyValues != null)
            {
                modifyPropertyValues("AmusementPark", amusementParkPropertyValues);
            }

            DSPResource amusementParkResource = CreateResource(roadTripMetadata, "AmusementPark", id, amusementParkPropertyValues.ToArray(), useComplexType);
            return amusementParkResource;
        }
Ejemplo n.º 6
0
        internal static DSPResource CreateTripLegResource(DSPMetadata roadTripMetadata, int id, ITestGeography geography1, ITestGeography geography2, bool useComplexType, Action<string, List<KeyValuePair<string, object>>> modifyPropertyValues)
        {
            List<KeyValuePair<string, object>> tripLegPropertyValues = new List<KeyValuePair<string, object>>()
            {
                new KeyValuePair<string, object>("GeographyProperty1", geography1.AsGeography()),
                new KeyValuePair<string, object>("GeographyProperty2", geography2.AsGeography()),
            };

            if (modifyPropertyValues != null)
            {
                modifyPropertyValues("TripLeg", tripLegPropertyValues);
            }
            DSPResource tripLegResource = CreateResource(roadTripMetadata, "TripLeg", id, tripLegPropertyValues.ToArray(), useComplexType);
            return tripLegResource;
        }
Ejemplo n.º 7
0
        private static void VerifyGeographyProperty(XElement properties, string propertyName, ITestGeography expectedValue)
        {
            XElement   property      = GetProperty(properties, propertyName);
            XAttribute typeAttribute = property.Attribute(UnitTestsUtil.MetadataNamespace + "type");

            if (typeAttribute != null)
            {
                string actualType   = property.Attribute(UnitTestsUtil.MetadataNamespace + "type").Value;
                string expectedtype = GetExpectedEdmShortQualifiedTypeName(expectedValue.AsGeography().GetType());
                Assert.AreEqual(expectedtype, actualType, "Type on Geography property is incorrect");
            }

            expectedValue.VerifyGmlContent(property);
        }
Ejemplo n.º 8
0
        internal static DSPResource CreateRestStopResource(DSPMetadata roadTripMetadata, int id, ITestGeography location, bool useComplexType, Action <string, List <KeyValuePair <string, object> > > modifyPropertyValues)
        {
            List <KeyValuePair <string, object> > restStopPropertyValues = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("GeographyProperty", location.AsGeography()),
            };

            if (modifyPropertyValues != null)
            {
                modifyPropertyValues("RestStop", restStopPropertyValues);
            }

            DSPResource restStopResource = CreateResource(roadTripMetadata, "RestStop", id, restStopPropertyValues.ToArray(), useComplexType);

            return(restStopResource);
        }
Ejemplo n.º 9
0
        internal static DSPResource CreateAmusementParkResource(DSPMetadata roadTripMetadata, int id, ITestGeography location, string name, bool useComplexType, Action <string, List <KeyValuePair <string, object> > > modifyPropertyValues)
        {
            List <KeyValuePair <string, object> > amusementParkPropertyValues = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("GeographyProperty", location.AsGeography()),
                new KeyValuePair <string, object>("Name", name),
            };

            if (modifyPropertyValues != null)
            {
                modifyPropertyValues("AmusementPark", amusementParkPropertyValues);
            }

            DSPResource amusementParkResource = CreateResource(roadTripMetadata, "AmusementPark", id, amusementParkPropertyValues.ToArray(), useComplexType);

            return(amusementParkResource);
        }
Ejemplo n.º 10
0
        internal static DSPResource CreateTripLegResource(DSPMetadata roadTripMetadata, int id, ITestGeography geography1, ITestGeography geography2, bool useComplexType, Action <string, List <KeyValuePair <string, object> > > modifyPropertyValues)
        {
            List <KeyValuePair <string, object> > tripLegPropertyValues = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("GeographyProperty1", geography1.AsGeography()),
                new KeyValuePair <string, object>("GeographyProperty2", geography2.AsGeography()),
            };

            if (modifyPropertyValues != null)
            {
                modifyPropertyValues("TripLeg", tripLegPropertyValues);
            }
            DSPResource tripLegResource = CreateResource(roadTripMetadata, "TripLeg", id, tripLegPropertyValues.ToArray(), useComplexType);

            return(tripLegResource);
        }