internal static DSPContext PopulateRoadTripData(DSPMetadata roadTripMetadata, GeographyPropertyValues defaultValues, bool useComplexType, Action<string, List<KeyValuePair<string, object>>> modifyPropertyValues = null) { var context = new DSPContext(); DSPResource tripLegResource = CreateTripLegResource(roadTripMetadata, DefaultId, defaultValues.TripLegGeography1, defaultValues.TripLegGeography2, useComplexType, modifyPropertyValues); PopulateResourceSet(context, tripLegResource); DSPResource amusementParkResource = CreateAmusementParkResource(roadTripMetadata, DefaultId, defaultValues.AmusementParkGeography, "Disneyland", useComplexType, modifyPropertyValues); PopulateResourceSet(context, amusementParkResource); DSPResource restStopResource = CreateRestStopResource(roadTripMetadata, DefaultId, defaultValues.RestStopGeography, useComplexType, modifyPropertyValues); PopulateResourceSet(context, restStopResource); return context; }
internal static DSPContext PopulateRoadTripData(DSPMetadata roadTripMetadata, GeographyPropertyValues defaultValues, bool useComplexType, Action <string, List <KeyValuePair <string, object> > > modifyPropertyValues = null) { var context = new DSPContext(); DSPResource tripLegResource = CreateTripLegResource(roadTripMetadata, DefaultId, defaultValues.TripLegGeography1, defaultValues.TripLegGeography2, useComplexType, modifyPropertyValues); PopulateResourceSet(context, tripLegResource); DSPResource amusementParkResource = CreateAmusementParkResource(roadTripMetadata, DefaultId, defaultValues.AmusementParkGeography, "Disneyland", useComplexType, modifyPropertyValues); PopulateResourceSet(context, amusementParkResource); DSPResource restStopResource = CreateRestStopResource(roadTripMetadata, DefaultId, defaultValues.RestStopGeography, useComplexType, modifyPropertyValues); PopulateResourceSet(context, restStopResource); return(context); }
internal static DSPUnitTestServiceDefinition CreateRoadTripServiceDefinition(DSPMetadata roadTripMetadata, GeographyPropertyValues defaultValues, DSPDataProviderKind providerKind, bool useComplexType = false, Action<string, List<KeyValuePair<string, object>>> modifyPropertyValues = null) { Assert.IsFalse(useComplexType, "Complex type support is not yet added to the property population in DSPUnitTestServiceDefinition."); DSPContext defaultData = PopulateRoadTripData(roadTripMetadata, defaultValues, useComplexType, modifyPropertyValues); var service = new DSPUnitTestServiceDefinition(roadTripMetadata, providerKind, defaultData); service.HostInterfaceType = typeof(IDataServiceHost2); service.DataServiceBehavior.AcceptSpatialLiteralsInQuery = true; service.Writable = true; service.DataServiceBehavior.MaxProtocolVersion = ODataProtocolVersion.V4; return service; }
internal static DSPUnitTestServiceDefinition CreateRoadTripServiceDefinition(DSPMetadata roadTripMetadata, GeographyPropertyValues defaultValues, DSPDataProviderKind providerKind, bool useComplexType = false, Action <string, List <KeyValuePair <string, object> > > modifyPropertyValues = null) { Assert.IsFalse(useComplexType, "Complex type support is not yet added to the property population in DSPUnitTestServiceDefinition."); DSPContext defaultData = PopulateRoadTripData(roadTripMetadata, defaultValues, useComplexType, modifyPropertyValues); var service = new DSPUnitTestServiceDefinition(roadTripMetadata, providerKind, defaultData); service.HostInterfaceType = typeof(IDataServiceHost2); service.DataServiceBehavior.AcceptSpatialLiteralsInQuery = true; service.Writable = true; service.DataServiceBehavior.MaxProtocolVersion = ODataProtocolVersion.V4; return(service); }