public void GeometryFromProviderValue_returns_null_for_null_value() { var nullSqlGeometry = new SqlTypesAssemblyLoader().GetSqlTypesAssembly().SqlGeometryType.GetDeclaredProperty("Null"); var convertedDbGeometry = SqlSpatialServices.Instance.GeometryFromProviderValue(nullSqlGeometry.GetValue(null, null)); Assert.Same(null, convertedDbGeometry); }
public void GeographyFromProviderValue_returns_null_for_null_value() { var nullSqlGeography = new SqlTypesAssemblyLoader().GetSqlTypesAssembly().SqlGeographyType .GetProperty("Null", BindingFlags.Static | BindingFlags.Public | BindingFlags.GetProperty); var convertedDbGeography = SqlSpatialServices.Instance.GeographyFromProviderValue(nullSqlGeography.GetValue(null, null)); Assert.Same(null, convertedDbGeography); }
public void GeometryFromProviderValue_returns_DbGeometry_for_non_null_value() { var dbGeometry = DbGeometry.FromText("POINT (90 50)"); var sqlGeometry = new SqlTypesAssemblyLoader().GetSqlTypesAssembly().ConvertToSqlTypesGeometry(dbGeometry); var convertedDbGeometry = SqlSpatialServices.Instance.GeometryFromProviderValue(sqlGeometry); Assert.Equal(dbGeometry.ProviderValue, convertedDbGeometry.ProviderValue); Assert.Equal(dbGeometry.CoordinateSystemId, convertedDbGeometry.CoordinateSystemId); }
private bool IsKnownAssembly(Assembly assembly) { foreach (string sqlTypesAssembly in this._preferredSqlTypesAssemblies) { if (SqlTypesAssemblyLoader.AssemblyNamesMatch(assembly.FullName, new AssemblyName(sqlTypesAssembly))) { return(true); } } return(false); }
public void GetSqlTypesAssembly_returns_specified_assembly() { SqlProviderServices.SqlServerTypesAssemblyName = SQL2008TypesName; try { var assemblyName = new SqlTypesAssemblyLoader().GetSqlTypesAssembly().SqlGeographyType.Assembly.FullName; Assert.True(assemblyName == SQL2008TypesName, assemblyName); } finally { SqlProviderServices.SqlServerTypesAssemblyName = null; } }
public void GeometryFromProviderValue_returns_null_for_null_value() { var nullSqlGeometry = new SqlTypesAssemblyLoader().GetSqlTypesAssembly().SqlGeometryType .GetProperty("Null", BindingFlags.Static | BindingFlags.Public | BindingFlags.GetProperty); var convertedDbGeometry = SqlSpatialServices.Instance.GeometryFromProviderValue(nullSqlGeometry.GetValue(null)); Assert.Same(null, convertedDbGeometry); }
public void GetSqlTypesAssembly_on_dev_machine_returns_assembly_for_SQL_2012_native_types() { var assemblyName = new SqlTypesAssemblyLoader().GetSqlTypesAssembly().SqlGeographyType.Assembly.FullName; Assert.True(assemblyName == SQL2012TypesName, assemblyName); }
public void GeographyFromProviderValue_returns_null_for_null_value() { var nullSqlGeography = new SqlTypesAssemblyLoader().GetSqlTypesAssembly().SqlGeographyType.GetDeclaredProperty("Null"); var convertedDbGeography = SqlSpatialServices.Instance.GeographyFromProviderValue(nullSqlGeography.GetValue(null, null)); Assert.Same(null, convertedDbGeography); }
public void TryGetSqlTypesAssembly_on_dev_machine_returns_assembly_for_SQL_native_types() { var assemblyName = new SqlTypesAssemblyLoader().TryGetSqlTypesAssembly().SqlGeographyType.Assembly.FullName; Assert.True(IsSqlTypesAssemblyName(assemblyName)); }